Skip to content

Merge pull request #35 from Hasnep/update-readme #47

Merge pull request #35 from Hasnep/update-readme

Merge pull request #35 from Hasnep/update-readme #47

name: Build and deploy
on:
# Run on each PR
pull_request:
# Run when a new commit is pushed to the main branch
push:
branches: [main]
jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Cache Nix environment
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Use Nix dev shell for subsequent steps
uses: rrbutani/use-nix-shell-action@v1
with:
extraNixOptions: --accept-flake-config
- name: Run pre-commit
run: pre-commit run --all-files
env:
# Prevent this action failing when running on the main branch
SKIP: no-commit-to-branch
- name: Download data
run: just download
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: just build
- name: Deploy to Netlify
uses: jsmrcaga/action-netlify-deploy@v2.0.0
with:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DEPLOY_TO_PROD: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
build_directory: build
install_command: echo 'Skipping installing the dependencies'
build_command: echo 'Skipping building the web files'