mirror of
https://github.com/danog/sass-site.git
synced 2024-12-13 09:57:35 +01:00
58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, 'feature.*']
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: npm
|
|
- name: Install & build
|
|
run: |
|
|
npm ci
|
|
npm run build-prod
|
|
- name: Check links
|
|
run: npm run checklinks:internal
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: npm
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Lint
|
|
run: npm run lint:ci
|
|
|
|
release:
|
|
name: Deploy
|
|
runs-on: ubuntu-latest
|
|
needs: [test, lint]
|
|
if: github.event_name == 'push' &&
|
|
github.ref == 'refs/heads/main' &&
|
|
github.repository == 'sass/sass-site'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
|
|
# Pushing to the production branch will trigger Netlify's release process.
|
|
- run: git push -f origin main:production
|