-
Notifications
You must be signed in to change notification settings - Fork 14
70 lines (64 loc) · 2.26 KB
/
build.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
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false # needed for JamesIves/github-pages-deploy-action
- name: Cache Ruby gems
id: cache-gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-1-${{ hashFiles('Gemfile.lock') }}
- name: Cache node_modules
id: cache-node
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
- name: Cache Bower libraries
id: cache-bower
uses: actions/cache@v2
with:
path: lib
key: ${{ runner.os }}-bower-${{ hashFiles('bower.json') }}
- name: Cache SmugMug
id: cache-smugmug
uses: actions/cache@v2
with:
path: tmp/smugmug
key: smugmug-1
- name: Pull SmugMug cache from S3
if: steps.cache-smugmug.outputs.cache-hit != 'true'
run: |
mkdir -p tmp
wget https://nthp.s3-eu-west-1.amazonaws.com/sm-cache.tar.xz -O tmp/sm-cache.tar.xz
tar xvf tmp/sm-cache.tar.xz
- name: Build
run: ./_bin/install
- name: Store build number
run: echo -n $(($GITHUB_RUN_NUMBER + 10000)) > _includes/travis_build_number.txt
- name: Build the site
run: docker-compose exec app npm run gulp:deploy
env:
SMUGMUG_API_KEY: ${{ secrets.SMUGMUG_API_KEY }}
SMUGMUG_CACHE_MAINTAIN: true
- name: Publish to GH Pages 🚀
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: JamesIves/[email protected]
with:
REPOSITORY_NAME: newtheatre/history-project-gh-pages
GITHUB_TOKEN: ${{ secrets.DEPLOY_PAT }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: _site # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
GIT_CONFIG_NAME: ntbot
GIT_CONFIG_EMAIL: [email protected]