From 27c91d43ed25fce5d93671bd87769f882e74f75c Mon Sep 17 00:00:00 2001 From: Naramsim Date: Tue, 9 Jan 2024 00:04:24 +0100 Subject: [PATCH] cicd: try gcloud --- .github/workflows/update-gql-data.yml | 31 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update-gql-data.yml b/.github/workflows/update-gql-data.yml index 435308d..fe08efd 100644 --- a/.github/workflows/update-gql-data.yml +++ b/.github/workflows/update-gql-data.yml @@ -15,15 +15,24 @@ jobs: with: project_id: 'pokeapi-215911' workload_identity_provider: 'projects/569595515170/locations/global/workloadIdentityPools/github/providers/deploy' - - uses: 'google-github-actions/ssh-compute@v1' + # - uses: 'google-github-actions/ssh-compute@v1' + # with: + # instance_name: 'graphql5' + # zone: 'us-east1-b' + # ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}' + # user: ga + # command: |- + # sudo -i + # (cd pokeapi && ls) + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' with: - instance_name: 'graphql5' - zone: 'us-east1-b' - ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}' - user: ga - command: |- - sudo -i - (cd pokeapi && ls) - - run: |- - echo '${{ steps.compute-ssh.outputs.stdout }}' - echo '${{ steps.compute-ssh.outputs.stderr }}' + version: '>= 363.0.0' + - name: write secret + env: + GCP_SSH_PRIVATE_KEY: ${{secrets.GCP_SSH_PRIVATE_KEY}} + shell: bash + run: | + echo "$GCP_SSH_PRIVATE_KEY" >> pk + - name: 'Use gcloud CLI' + run: 'gcloud compute ssh ga@graphql5 --zone us-east1-b --ssh-key-file pk --quiet --command "pwd"'