Skip to content

CICD Gotenberg

CICD Gotenberg #6

name: CICD Gotenberg
on:
push:
paths:
- gotenberg/**
- nais/dev-gcp-gotenberg.yaml
- nais/prod-gcp-gotenberg.yaml
workflow_dispatch:
schedule:
- cron: '0 6 * * 1' # bygg nytt image hver mandag morgen
jobs:
compile-test-and-build:
name: Compile, build and deploy image
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: fager
image_suffix: gotenberg
tag: ${{ github.sha }}
dockerfile: gotenberg/Dockerfile
docker_context: gotenberg
salsa: false
deploy-dev:
if: github.ref == 'refs/heads/main'
needs: [ compile-test-and-build ]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- name: Deploy dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
VAR: image=${{ needs.compile-test-and-build.outputs.image }}
RESOURCE: nais/dev-gcp-gotenberg.yaml
CLUSTER: dev-gcp
deploy-prod:
if: github.ref == 'refs/heads/main'
needs: [ compile-test-and-build ]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- name: Deploy prod-gcp
uses: nais/deploy/actions/deploy@v2
env:
VAR: image=${{ needs.compile-test-and-build.outputs.image }}
RESOURCE: nais/prod-gcp-gotenberg.yaml
CLUSTER: prod-gcp