-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.18 KB
/
production.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
name: Production
on:
pull_request:
types: ['opened', 'edited', 'synchronize', 'closed']
branches: ['main']
jobs:
build:
name: Build Project
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Archive build artifacts
run: tar -czf build.tar.gz dist
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-dist
path: build.tar.gz
copy:
name: Archive and Copy
if: github.event_name == 'pull_request' && github.event.action == 'closed'
needs: build
runs-on: self-hosted
environment: production
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-dist
path: .
- name: Extract build artifacts
run: tar -xzf build.tar.gz
- name: Copy folder to where nginx expects it to be
run: cp -r dist/* ${{secrets.COPY_TO_FOLDER}}