-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 1.55 KB
/
master.yml
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
55
56
57
58
59
60
61
62
63
name: master
on:
push:
branches:
- master
env:
BASE_IMAGENAME: ghcr.io/${{ github.repository }}/spre-gosys-pdf
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Declare outputs
id: declare
run: |
echo "image=${BASE_IMAGENAME}:$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
outputs:
image: "${{ steps.declare.outputs.image }}"
build:
needs: setup
runs-on: ubuntu-latest
env:
IMAGE: "${{ needs.setup.outputs.image }}"
steps:
- uses: actions/checkout@v1
- name: build docker image
run: docker build -t ${IMAGE} .
- name: push docker image
run: |
docker login --username "$GITHUB_REPOSITORY" -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
docker push ${IMAGE}
deployDev:
name: Deploy to dev
needs: [setup, build]
runs-on: ubuntu-latest
env:
IMAGE: "${{ needs.setup.outputs.image }}"
steps:
- uses: actions/checkout@v1
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: deploy/dev.yml
deployProd:
name: Deploy to prod
needs: [setup, build, deployDev]
runs-on: ubuntu-latest
env:
IMAGE: "${{ needs.setup.outputs.image }}"
steps:
- uses: actions/checkout@v1
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-fss
RESOURCE: deploy/prod.yml