Test previous workflow 6 #414
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker | |
on: | |
push: | |
branches: | |
- feat/gsm-config-update | |
# - develop | |
# - staging | |
# - main | |
env: | |
IMAGE_NAME: europe-docker.pkg.dev/jumper-g-artifacts/docker-jumper-exchange/jumpex | |
PROJECT_ID: jumper-g-management | |
GCP_REGION: europe-west1 | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- 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: Access and Verify GCP Secrets | |
id: secrets | |
run: | | |
echo "Fetching secret from jumper-d-dev project..." | |
SECRET_VALUE=$(gcloud secrets versions access latest --secret="jumper-exchange-env" --project="jumper-d-dev") | |
echo $SECRET_VALUE | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.gcpauth.outputs.credentials_file_path }} |