-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (117 loc) · 4.22 KB
/
release.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build and Release to Production
on:
push:
tags:
- "v*"
permissions:
id-token: write
contents: write
packages: write
jobs:
build-frontend-docker:
uses: ./.github/workflows/frontend-docker.yml
with:
tag: ${{ github.ref_name }}
secrets: inherit
build-backend-docker:
uses: ./.github/workflows/backend-docker.yml
with:
tag: ${{ github.ref_name }}
secrets: inherit
build-frontend:
needs: [build-frontend-docker]
uses: ./.github/workflows/frontend.yml
with:
tag: ${{ github.ref_name }}
secrets: inherit
release-github:
needs: [build-backend-docker, build-frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: frontend-build
path: dist/frontend/
- name: Create Frontend Build Archive
run: cd dist/ && tar -czf frontend-build.tar frontend/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/frontend-build.tar
tag_name: ${{ github.ref_name }}
body_path: CHANGELOG.md
release-docker:
needs: [release-github]
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Create Frontend Docker Release
uses: ./.github/actions/docker-release
with:
release_tag: ${{ github.ref_name }}
image_name: ${{ vars.FRONTEND_IMAGE_NAME }}
old_tag: main-dev
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create Backend Docker Release
uses: ./.github/actions/docker-release
with:
release_tag: ${{ github.ref_name }}
image_name: ${{ vars.BACKEND_IMAGE_NAME }}
old_tag: main
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
release-cloudflare:
needs: [build-frontend, release-github]
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.deployment-url }}
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: frontend-build
path: dist/frontend/
- name: Upload Build Artifacts
uses: cloudflare/wrangler-action@v3
id: deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist/frontend/ --project-name=tmvisdb
release-sentry:
needs: [release-github]
environment: production
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: frontend-build
path: dist/frontend/
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
version: ${{ github.ref_name }}
sourcemaps: ./dist/frontend/
url_prefix: "~"