-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (57 loc) · 1.73 KB
/
cd.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
name: CD
on:
push:
branches: [main, dev]
jobs:
gh-release:
runs-on: ubuntu-latest
permissions:
actions: none
checks: none
contents: write
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
- name: "Set up Node.js"
uses: actions/[email protected]
with:
node-version: 16
- name: "Install all dependencies"
run: npm ci --prefix frontend
- name: "Run build"
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]
then
# build for the main website
npm run build --prefix frontend
else
# build for the beta subfolder
npm run build --prefix frontend -- --base=/beta
fi
- name: "Determine sublocation"
id: determine_sublocation
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]
then
# set root folder for main branch
echo "::set-output name=sublocation::"
else
# set beta folder for dev branch
echo "::set-output name=sublocation::beta"
fi
- name: Release to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./frontend/dist
destination_dir: ${{ steps.determine_sublocation.outputs.sublocation }}
cname: app.jimmi.party