-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (51 loc) · 1.55 KB
/
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
name: Deploy
on:
release:
types:
- published
jobs:
build:
name: Build
if: github.repository == 'ADOFAI-gg/ADOFAI-gg-Web'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Build
run: VITE_API_BASE_URL=https://adofai.gg:9200 VITE_UA_NUMBER='UA-181311513-1' VITE_GA_NUMBER='G-3BKXMVNJYQ' yarn build
- name: Zip output
run: cd dist && zip -r ../dist.zip . && cd ..
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist.zip
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.repository == 'ADOFAI-gg/ADOFAI-gg-Web'
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
- name: Upload build to server
run: curl -F 'file=@dist.zip' -F 'token=${{ secrets.BUILD_UPLOAD_TOKEN }}' ${{ secrets.BUILD_UPLOAD_URL }}