| name: "Activate Service Account" |
| description: Setup a Service account with the key provided in base64 as an input |
| inputs: |
| GCP_SERVICE_ACCOUNT: |
| description: Service account to activate in base64 format |
| required: true |
| |
| runs: |
| using: composite |
| steps: |
| - name: Setup GCP account |
| env: |
| SA_KEY_CONTENT: ${{inputs.GCP_SERVICE_ACCOUNT}} |
| shell: bash |
| run: | |
| echo "$SA_KEY_CONTENT" | base64 -d > /tmp/gcp_access.json |
| gcloud auth activate-service-account --key-file="/tmp/gcp_access.json" --no-user-output-enabled |
| gcloud auth configure-docker -q --no-user-output-enabled >& /dev/null |
| - name: Removing Keyfile |
| if: ${{ always() }} |
| shell: bash |
| run: rm -f /tmp/gcp_access.json |