Skip to content

Merge pull request #42 from NIVANorge/dev #26

Merge pull request #42 from NIVANorge/dev

Merge pull request #42 from NIVANorge/dev #26

Workflow file for this run

name: Build & Push
on:
push:
branches:
- 'master'
paths:
- '.github/workflows/**'
- 'app/**'
- 'Dockerfile'
env:
IMAGE_NAME: martini
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: europe-west1-docker.pkg.dev/niva-cd/images/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=
type=raw,value=latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
token_format: access_token
workload_identity_provider: "${{ secrets.POOL }}"
service_account: "${{ secrets.SA }}"
- name: Login to Artifact Registry
uses: "docker/login-action@v2"
with:
registry: "europe-west1-docker.pkg.dev"
username: "oauth2accesstoken"
password: "${{ steps.auth.outputs.access_token }}"
- id: docker_push
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}