-
Notifications
You must be signed in to change notification settings - Fork 11
122 lines (107 loc) · 3.67 KB
/
release-web.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
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
name: Release Web
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
- '.vscode/**'
- '.idea/**'
concurrency: deploy-to-production
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
packages: read
jobs:
ci:
name: CI
uses: makerxstudio/shared-config/.github/workflows/node-ci.yml@main
with:
working-directory: .
node-version: 20.x
audit-script: npm run audit
compile-script: npm run check-types
test-script: npm run test
pre-test-script: |
pipx install algokit
algokit localnet start
npx --yes wait-on tcp:4001 -t 30000
build-website:
name: Build Website
uses: makerxstudio/shared-config/.github/workflows/node-build-zip.yml@main
with:
node-version: 20.x
build-path: dist
artifact-name: website
static-site: true
static-site-env-prefix: VITE
needs:
- ci
deploy-to-staging:
name: Publish Website to Staging
needs:
- build-website
runs-on: [ubuntu-22.04]
environment: Staging
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: website
path: artifacts
- name: Unzip
run: |
cd artifacts
mkdir -p website
unzip website.zip -d website
- name: Apply Staging Transforms
uses: makerxstudio/shared-config/.github/actions/placeholder-transforms@main
with:
app-artifact-path: artifacts/website
static-site-transforms: |-
VITE_DISPENSER_AUTH0_DOMAIN:dispenser-staging.eu.auth0.com
VITE_DISPENSER_AUTH0_CLIENT_ID:pSffrx40HwIdWAJFeGCsy5FZn2NzYIvO
VITE_DISPENSER_AUTH0_AUDIENCE:api-staging-dispenser-user
VITE_TESTNET_DISPENSER_API_URL:https://api.dispenser-dev.algorandfoundation.tools
VITE_TESTNET_DISPENSER_ADDRESS:A3Q4VQFQ5DLEIWCMUX6V7YFZ7BUPWUXWY4YVNJQODUODSQ7KVEFOZUNFUQ
- name: Deploy website to Netlify
run: |
npx netlify-cli deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --dir artifacts/website --prod
deploy-to-production:
name: Publish Website to Production
needs:
- deploy-to-staging
runs-on: [ubuntu-22.04]
environment: Production
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: website
path: artifacts
- name: Unzip
run: |
cd artifacts
mkdir -p website
unzip website.zip -d website
- name: Apply Production Transforms
uses: makerxstudio/shared-config/.github/actions/placeholder-transforms@main
with:
app-artifact-path: artifacts/website
static-site-transforms: |-
VITE_DISPENSER_AUTH0_DOMAIN:dispenser-prod.eu.auth0.com
VITE_DISPENSER_AUTH0_CLIENT_ID:Cg13HjvSV45pMme4dnK9yVJde8tVeDaM
VITE_DISPENSER_AUTH0_AUDIENCE:api-prod-dispenser-user
VITE_TESTNET_DISPENSER_API_URL:https://api.dispenser.algorandfoundation.tools
VITE_TESTNET_DISPENSER_ADDRESS:Z5GPJQCHVU54C2I4FLYNE2XHRQRL5OV2GPJQKXJFMW34CRIN2KRQFXF7DI
- name: Deploy website to Netlify
run: |
npx netlify-cli deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --dir artifacts/website --prod