Skip to content

Release app

Release app #11

Workflow file for this run

name: Release app
on:
workflow_dispatch:
jobs:
docker-build-and-publish:
name: Build and publish docker image
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: 'google-github-actions/auth@v2'
with:
project_id: 'earnest-reactor-416012'
workload_identity_provider: 'projects/200867752258/locations/global/workloadIdentityPools/github-actions/providers/github-actions'
- name: Set up Cloud SDK
uses: google-github-actions/[email protected]
- name: Configure auth in GCR
run: gcloud auth configure-docker
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: europe-west1-docker.pkg.dev/earnest-reactor-416012/docker-repository/test-app
tags: |
type=sha
type=raw,value={{branch}}-{{sha}}-{{date 'X'}},enable=${{ startsWith(github.ref, 'refs/heads') }}
type=raw,value={{branch}},enable=${{ startsWith(github.ref, 'refs/heads') }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/x86_64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# patch-values:
# name: Patch values with new tag
# needs: docker-build-and-publish
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Update values.yaml
# uses: fjogeleit/yaml-update-action@master
# with:
# valueFile: 'argocd/test-app/version.yaml'
# propertyPath: 'image.tag'
# value: ${{ github.sha }}
# branch: master
# createPR: false
# message: 'Update test-app image Version to ${{ github.sha }}'