sass-site/.github/workflows/ci.yml

59 lines
1.2 KiB
YAML
Raw Normal View History

name: CI
2023-01-09 21:24:06 +01:00
on:
push:
branches: [main, 'feature.*']
2023-01-09 21:24:06 +01:00
pull_request:
types: [reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
2023-06-16 02:00:55 +02:00
test:
name: Test
2023-06-16 01:47:14 +02:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
2023-06-20 00:12:39 +02:00
cache: npm
2023-06-16 02:00:55 +02:00
- name: Install & build
2023-06-16 01:47:14 +02:00
run: |
2023-06-20 00:12:39 +02:00
npm ci
npm run build-prod
2023-06-16 02:00:55 +02:00
- name: Check links
2023-06-20 00:12:39 +02:00
run: npm run checklinks:internal
2023-01-09 21:24:06 +01:00
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
2023-06-20 00:12:39 +02:00
cache: npm
2023-01-09 21:24:06 +01:00
- name: Install dependencies
2023-06-20 00:12:39 +02:00
run: npm ci
2023-01-09 21:24:06 +01:00
- name: Lint
2023-06-20 00:12:39 +02:00
run: npm run lint:ci
release:
name: Deploy
runs-on: ubuntu-latest
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