-
-
Notifications
You must be signed in to change notification settings - Fork 42
103 lines (91 loc) · 2.6 KB
/
prod.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build and deploy (production)
on:
release:
types: [published]
env:
RELEASE_NAME: website
CHART_VALUES_FILE: .helm/values.prod.yml
DEPLOY_NAMESPACE: sledilnik-prod
DEPLOY_ENV: production
DEPLOY_URL: https://covid-19.sledilnik.org
IMAGE_TAG: ${{ github.event.release.tag_name }}
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Debug
uses: hmarr/[email protected]
- name: Checkout repo
uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: '18'
- run: yarn
- run: yarn lint
# - run: yarn test
# - run: yarn dotnet-restore
# - run: yarn test-fsharp
build:
runs-on: ubuntu-20.04
needs: test
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push docker container image
uses: docker/build-push-action@v4
with:
push: true
context: .
file: ./Dockerfile
tags: |
ghcr.io/${{ github.repository_owner }}/website:${{ env.IMAGE_TAG}}
build-args: |
BUILD_MODE=production
deploy:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Deploy
uses: sledilnik/[email protected]
with:
chartName: sledilnik/website
chartVersion: '1.0.0'
kubeconfig: '${{ secrets.KUBECONFIG }}'
- name: Slack notification
uses: 8398a7/action-slack@v3
with:
icon_url: 'https;//github.com/sledilnik.png?size=32'
author_name: 'Deploy bot'
status: custom
fields: repo,workflow,job
custom_payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Production deploy finished with status: ${{ job.status }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "URL: ${{ env.DEPLOY_URL }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}