Mucking about #458
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -T 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/github-pages-deploy-action@3.7.1 | |
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: webmaster@newtheatre.org.uk |