-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (59 loc) · 1.91 KB
/
deploy.yml
File metadata and controls
79 lines (59 loc) · 1.91 KB
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
name: Deploy to GitHub Pages
on:
push:
branches:
- main # Set this to your default branch
paths-ignore:
- 'docs/**'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.NGBASE_DEPLOY_KEY }}" > ~/.ssh/ng_base_key
chmod 600 ~/.ssh/ng_base_key
cat <<EOF > ~/.ssh/config
Host github-ngbase
HostName github.com
User git
IdentityFile ~/.ssh/ng_base_key
IdentitiesOnly yes
EOF
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'app/package-lock.json'
- name: Install dependencies
working-directory: ./app
run: npm install
- name: Build
working-directory: ./app
run: npm run build -- --configuration production --base-href "/"
- name: Create CNAME file
run: mkdir -p ./docs/browser && echo "www.dunderlab.com" > ./docs/browser/CNAME && mkdir -p /tmp/docs/ && mv ./docs/browser/* /tmp/docs/
- name: Deploy to static
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin
git checkout --orphan static
git rm -rf .
cp -r /tmp/docs/* .
touch .nojekyll
git add .
git commit -m "Deploy ${{ github.sha }}"
git push -f origin static