forked from Eisvana/EisvanaWikiPageCreator
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (68 loc) · 1.92 KB
/
build-deploy.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
name: Build
run-name: Build Code
on:
push:
branches: ['main', 'staging']
permissions:
contents: write
concurrency:
group: "build-deploy"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Build App
run: |
if [[ "${{ github.ref }}" == "refs/heads/staging" ]]; then
sed -i 's_EisvanaWikiPageCreator_EisvanaWikiPageCreator/staging_g' vite.config.ts
fi
npm ci
npm run build
cd dist
touch .nojekyll
- name: Minify Code
uses: Lenni009/minify-js@main
with:
directory: dist
overwrite: true
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: EisvanaWikiPageCreator
path: dist
deploy-prod:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: EisvanaWikiPageCreator
path: dist
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist # The folder the action should deploy.
deploy-staging:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/staging'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: EisvanaWikiPageCreator
path: dist
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist # The folder the action should deploy.
target-folder: staging # The folder the action should deploy to.