nginxconfig.io/.github/workflows/gh-pages-workflow.yml
2020-04-27 20:30:56 +01:00

38 lines
813 B
YAML

name: Test and Deploy to GitHub Pages
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: npm ci, test, and build
run: |
npm ci
npm test
npm run build
env:
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
- name: Deploy master to GitHub Pages
uses: JamesIves/github-pages-deploy-action@2.0.0
env:
ACCESS_TOKEN: ${{ secrets.DEV_GITHUB_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages
FOLDER: dist