Skip to content

Use packaged action for what changed #91

Use packaged action for what changed

Use packaged action for what changed #91

Workflow file for this run

name: Create docker image
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
paths-ignore:
- "*.md"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
actions: read
pull-requests: read
steps:
- uses: "actions/checkout@v4"
- name: Determine what to do
id: changed-files
uses: "nais/what-changed@main"
with:
files: "nais/nais.yaml,nais/topic.yaml"
- uses: nais/platform-build-push-sign@main
id: build-push-sign
if: steps.changed-files.outputs.changed != 'only-inputs'
with:
name: karapace
google_service_account: gh-karapace
push: ${{ github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/main' }}
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
outputs:
changed: "${{ steps.changed-files.outputs.changed }}"
image: "${{ steps.build-push-sign.outputs.tag }}"
deploy:
name: "deploy for testing"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
steps:
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # ratchet:actions/checkout@v2
- uses: nais/deploy/actions/deploy@v2
name: Deploy resources and image if built
if: needs.build.outputs.changed != 'non-inputs'
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/nais.yaml,nais/topic.yaml
WORKLOAD_IMAGE: ${{ needs.build.outputs.image }}
- uses: nais/deploy/actions/deploy@v2
name: Deploy only updated image
if: needs.build.outputs.changed == 'non-inputs'
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
WORKLOAD_NAME: karapace-test
WORKLOAD_IMAGE: ${{ needs.build.outputs.image }}
TEAM: nais