-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (34 loc) · 1.32 KB
/
deploy-website.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
name: Gatsby Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Initialize GH User
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Set Node.js
uses: actions/setup-node@master
with:
node-version: '16'
- name: Install dependencies
run: yarn install
- name: Add production Config
run: echo "GITHUB_TOKEN=${{ secrets.DEPLOY_KEY }}" > .env.production
- name: Build
run: yarn run build
- name: Deploy
run: |
# Add in the correct CNAME
echo "cannonlock.com" > public/CNAME
# Commit the build then use 'git subtree' to create a branch with just the public contents
git add public -f
git commit -m "Build Production Website"
git checkout -b gh-pages `git subtree split --prefix public master`
# Push to Production
git push --set-upstream origin gh-pages --force