-
Notifications
You must be signed in to change notification settings - Fork 21
80 lines (67 loc) · 2 KB
/
deploy_external-bln.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
name: Radar External Deployment
on:
push:
branches:
- master
jobs:
build:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: "14"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install
run: npm install
- name: nuxt generate
run: npm run generate
env:
BASE_URL: ${{ secrets.BASE_URL }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
SCOPE: "public"
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build
path: dist
if-no-files-found: error
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout deploy repo
uses: actions/checkout@v2
with:
repository: TechLabs-Berlin/radar-external.git
token: ${{ secrets.PAT }}
ref: deploy
path: deploy
- name: Download build
uses: actions/download-artifact@v2
with:
name: build
path: build
- name: Copy frontend build to deploy repo
run: |
cp -r deploy/.git deploy/CNAME deploy/README.md build/
- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "TechLabs Berlin GitHub Workflow"
- name: Commit deploy repo
run: |
git add --all --force .
git commit -m "Add frontend build at $(date +%FT%T%Z)" --allow-empty
working-directory: build
- name: Push deploy repo
run: git push https://${{secrets.PAT}}:[email protected]/TechLabs-Berlin/radar-external.git
working-directory: build