Skip to content

fix

fix #7

Workflow file for this run

name: Deployment
on:
push:
branches:
- development
jobs:
deployment:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name }}
concurrency: ${{ github.ref_name }}
env:
REGISTRY: ${{ vars.REGISTRY }}
IMAGE: ${{ secrets.REPOSITORY }}/mirc-ctp
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.WORKLOAD_IDENTITY_PROJECT }}
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
- name: Configure docker for Google artifact registry
id: docker
run: |
gcloud auth configure-docker ${{ env.REGISTRY }}
branch=${GITHUB_REF##*/}
ts=$(date +%Y%m%d%H%M%S)
echo "BUILD_ID=${branch}-${ts}" >> $GITHUB_OUTPUT
echo "BRANCH_NAME=${branch}" >> $GITHUB_OUTPUT
- name: Setup buildx so we can use GHA caching
uses: docker/setup-buildx-action@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
- name: Run make
run: make install
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.docker.outputs.BUILD_ID }}
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.docker.outputs.BRANCH_NAME }}
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest