From 252af1cce4c12d25ef4248de53835c6721b94804 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 8 Jan 2024 21:44:43 +0100 Subject: [PATCH] cicd: try connection to instance --- .github/workflows/update-gql-data.yml | 28 +++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/update-gql-data.yml diff --git a/.github/workflows/update-gql-data.yml b/.github/workflows/update-gql-data.yml new file mode 100644 index 0000000..16a080e --- /dev/null +++ b/.github/workflows/update-gql-data.yml @@ -0,0 +1,28 @@ +name: update-gql-data +on: + push: + branches: + - gql +jobs: + update-gql-data: + runs-on: ubuntu-22.04 + permissions: + contents: 'read' + id-token: 'write' + steps: + - uses: 'actions/checkout@v4' + - uses: 'google-github-actions/auth@v2' + with: + project_id: 'pokeapi-215911' + workload_identity_provider: 'projects/569595515170/locations/global/workloadIdentityPools/github/providers/deploy' + - uses: 'google-github-actions/ssh-compute@v1' + with: + instance_name: 'graphql5' + zone: 'us-east1-b' + ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}' + command: |- + sudo -i + (cd pokeapi && ls) + - run: |- + echo '${{ steps.compute-ssh.outputs.stdout }}' + echo '${{ steps.compute-ssh.outputs.stderr }}' diff --git a/.gitignore b/.gitignore index f493f27..44b0c4d 100644 --- a/.gitignore +++ b/.gitignore @@ -171,3 +171,4 @@ modules.xml # End of https://www.gitignore.io/api/node,firebase,webstorm+all +gha-creds-*.json