Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
Add docker build job
Browse files Browse the repository at this point in the history
  • Loading branch information
gratus-acuitymd committed Sep 20, 2024
1 parent 5a967b2 commit e78924b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/buildimage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Locust build image
on:
workflow_dispatch:
push:
branches:
- "master"
defaults:
run:
shell: bash
permissions:
contents: read
id-token: write
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
env:
REGISTRY: us-east1-docker.pkg.dev/acuitymd-core-services/python
TAG: ${{ github.sha }}
ENV: dev
jobs:
build-locust:
name: Locust build image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
token_format: "access_token"
workload_identity_provider: ${{ vars.DEV_GCP_GHA_WORKLOAD_IDP}}
service_account: ${{ vars.DEV_GCP_GHA_SERVICE_ACCOUNT}}
- name: Login to Google Artifact Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Pushs
uses: docker/build-push-action@v5
env:
APP: locust
with:
file: ./Dockerfile
push: true
provenance: false
tags: ${{ env.REGISTRY }}/${{ env.APP }}:${{ env.TAG }}, ${{ env.REGISTRY }}/${{ env.APP }}:latest
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit e78924b

Please sign in to comment.