mirror of
https://github.com/digitalocean/nginxconfig.io
synced 2024-11-10 12:34:12 +00:00
f44832ed7a
* Update Spaces workflow * Update Pages workflow * Update test workflow
55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
name: Test and deploy to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: gh-pages-workflow
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: npm
|
|
|
|
- name: Setup NPM
|
|
run: |
|
|
NPM_VERSION=$(jq -r .engines.npm package.json)
|
|
NPM_VERSION=${NPM_VERSION/\^/}
|
|
if [ "$(npm --version)" != "$NPM_VERSION" ]; then
|
|
npm install -g npm@$NPM_VERSION && npm --version
|
|
else
|
|
echo "NPM version is same as package.json engines.npm"
|
|
fi
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Test before production
|
|
run: npm test
|
|
|
|
- name: Build tool
|
|
run: npm run build
|
|
env:
|
|
NODE_ENV: production
|
|
|
|
- name: Deploy master to GitHub Pages
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
|
with:
|
|
folder: dist
|
|
clean: true
|
|
single-commit: true
|