-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 1.62 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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"
with:
fetch-depth: 0
- 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
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/nais.yaml,nais/topic.yaml
WORKLOAD_IMAGE: ${{ needs.build.outputs.image }}