Skip to content

Commit

Permalink
Test previous workflow 7
Browse files Browse the repository at this point in the history
  • Loading branch information
adityalifi committed Feb 13, 2025
1 parent be56dcc commit d657aa4
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,28 @@ jobs:
- name: Checkout
uses: actions/checkout@v4 # Updated to latest version

- name: Set current date as env variable
run: echo "UNIQ_ID=$(date +'%y%m%d')-${GITHUB_SHA:0:7}" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Authenticate to Google Cloud
id: gcpauth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
create_credentials_file: true
workload_identity_provider: 'projects/800848389157/locations/global/workloadIdentityPools/github/providers/github'
service_account: 'artifact-deployer-secret@jumper-g-management.iam.gserviceaccount.com'

- name: Login to Artifact Registry
uses: docker/login-action@v3
with:
registry: europe-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcpauth.outputs.access_token }}

- name: Set Environment Variables
id: set-env
run: |
if [[ $GITHUB_REF == 'refs/heads/develop' ]]; then
echo "GCP_PROJECT=jumper-d-dev" >> $GITHUB_ENV
elif [[ $GITHUB_REF == 'refs/heads/staging' ]]; then
echo "GCP_PROJECT=jumper-s-staging" >> $GITHUB_ENV
elif [[ $GITHUB_REF == 'refs/heads/main' ]]; then
echo "GCP_PROJECT=jumper-p-prod" >> $GITHUB_ENV
else
echo "GCP_PROJECT=jumper-d-dev" >> $GITHUB_ENV
fi
- name: Access Environment Secrets
id: secrets
run: |
echo "Fetching secrets from project: ${{ env.GCP_PROJECT }}"
SECRET_VALUE=$(gcloud secrets versions access latest --secret="jumper-exchange-env" --project="${{ env.GCP_PROJECT }}")
echo "SECRET_VALUE=$SECRET_VALUE" >> $GITHUB_ENV
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.gcpauth.outputs.credentials_file_path }}

- name: Access and Verify GCP Secrets
id: secrets
run: |
Expand Down

0 comments on commit d657aa4

Please sign in to comment.