diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 0000000..04cf60e --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,28 @@ +name: GitHub Actions Demo - ssh test +run-name: ${{ github.actor }} testing ssh +on: [push] +jobs: + job_id: + runs-on: ubuntu-latest + steps: + - uses: 'actions/checkout@v4' + + - id: 'auth' + 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 }}' + user: 'henrylin' + command: 'ls -al' + + # Example of using the output + - id: 'test' + run: |- + echo '${{ steps.compute-ssh.outputs.stdout }}' + echo '${{ steps.compute-ssh.outputs.stderr }}'