-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (78 loc) · 2.44 KB
/
deploy-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
name: deploy-prod
on:
workflow_dispatch:
env:
SKAFFOLD_DEFAULT_REPO: ghcr.io/con2
jobs:
deploy:
if: github.ref == 'refs/heads/main'
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Check if skaffold and kubectl found from cache
id: cache-bin
uses: actions/cache@v4
with:
path: bin
key: ${{ runner.os }}-bin
- name: Download skaffold and kubectl
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir bin
curl -Lo bin/skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
curl -Lo bin/kubectl https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl
chmod +x bin/skaffold bin/kubectl
- name: Add skaffold and kubectl to PATH
run: echo "$PWD/bin" >> "$GITHUB_PATH"
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PASSWORD }}
- uses: docker/setup-buildx-action@v3
- run: |
python3 -m pip install setuptools emskaffolden
emskaffolden -E production -- run -n konsti-production
sentry-release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
env:
CI: true
HUSKY: 0
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js 20.16.0
uses: actions/setup-node@v4
with:
node-version: 20.16.0
cache: "yarn"
- name: Yarn install
run: |
yarn --immutable
- name: Build prod frontend
run: |
yarn build-front:prod
- name: Create prod frontend Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: konsti
SENTRY_PROJECT: konsti-frontend-prod
with:
sourcemaps: "./client/build"
ignore_missing: true
ignore_empty: true
- name: Create prod backend Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: konsti
SENTRY_PROJECT: konsti-backend-prod
with:
ignore_missing: true
ignore_empty: true