From 0ec38332f44da7a06968f7f01c0266f22f199eae Mon Sep 17 00:00:00 2001 From: hlin-neo4j <50340794+hlin-neo4j@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:18:44 -0400 Subject: [PATCH 1/6] Create github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 0000000..15a61d6 --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From bb0db40b0e312532bc58afd397d249fadb5b49e6 Mon Sep 17 00:00:00 2001 From: hlin-neo4j <50340794+hlin-neo4j@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:56:25 -0400 Subject: [PATCH 2/6] Update github-actions-demo.yml gcp auth --- .github/workflows/github-actions-demo.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 15a61d6..e040188 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -1,18 +1,13 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +name: GitHub Actions Demo - ssh test +run-name: ${{ github.actor }} testing ssh on: [push] jobs: - Explore-GitHub-Actions: + job_id: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." + - uses: 'actions/checkout@v4' + + - id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.gcp_credentials }}' From 214fdd2dd1bef5b3dfd31cb020d8e6cce654a237 Mon Sep 17 00:00:00 2001 From: hlin-neo4j <50340794+hlin-neo4j@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:06:46 -0400 Subject: [PATCH 3/6] Update github-actions-demo.yml ssh --- .github/workflows/github-actions-demo.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index e040188..b597e3f 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -11,3 +11,17 @@ jobs: uses: 'google-github-actions/auth@v2' with: credentials_json: '${{ secrets.gcp_credentials }}' + + - id: 'compute-ssh' + uses: 'google-github-actions/ssh-compute@v1' + with: + instance_name: 'hltest-qau-ui' + zone: 'us-east1-b' + ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}' + command: 'ls -al' + + # Example of using the output + - id: 'test' + run: |- + echo '${{ steps.compute-ssh.outputs.stdout }}' + echo '${{ steps.compute-ssh.outputs.stderr }}' From 9dcf239752f7991ab36ea812ff8abe0a863b7dfe Mon Sep 17 00:00:00 2001 From: hlin-neo4j <50340794+hlin-neo4j@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:18:23 -0400 Subject: [PATCH 4/6] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index b597e3f..34c873b 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -18,7 +18,7 @@ jobs: instance_name: 'hltest-qau-ui' zone: 'us-east1-b' ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}' - command: 'ls -al' + command: 'echo Hello world' # Example of using the output - id: 'test' From 8c485ecb7b67a429a9cc0bf0762e847bd6babccf Mon Sep 17 00:00:00 2001 From: hlin-neo4j <50340794+hlin-neo4j@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:22:39 -0400 Subject: [PATCH 5/6] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 34c873b..b597e3f 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -18,7 +18,7 @@ jobs: instance_name: 'hltest-qau-ui' zone: 'us-east1-b' ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}' - command: 'echo Hello world' + command: 'ls -al' # Example of using the output - id: 'test' From 68918c5c4ba02696b5c337c725f58770988c34d8 Mon Sep 17 00:00:00 2001 From: hlin-neo4j <50340794+hlin-neo4j@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:40:36 -0400 Subject: [PATCH 6/6] Update github-actions-demo.yml user henrylin --- .github/workflows/github-actions-demo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index b597e3f..04cf60e 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -18,6 +18,7 @@ jobs: instance_name: 'hltest-qau-ui' zone: 'us-east1-b' ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}' + user: 'henrylin' command: 'ls -al' # Example of using the output