website/.github/workflows/build.yml

42 lines
1.2 KiB
YAML
Raw Normal View History

2022-11-28 03:17:59 +00:00
name: "Build and deploy to Netlify"
on:
push:
branches:
- master
- content/*
workflow_run:
workflows:
- "Update webring"
types:
- "completed"
2022-11-28 03:17:59 +00:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
2022-11-28 03:17:59 +00:00
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Fetch all 'content/' branches
run: |
git fetch origin +refs/heads/*:refs/heads/*
2022-11-28 03:17:59 +00:00
- run: nix develop -c make build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: ./public
netlify-config-path: ./netlify.toml
production-branch: master
production-deploy: ${{ github.ref_name == 'master' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: true
enable-commit-status: true
overwrites-pull-request-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}