2021-08-25 22:40:42 +00:00
|
|
|
name: "Frontend: Build & Deploy to Netlify"
|
2020-04-10 09:04:03 +00:00
|
|
|
on:
|
2021-08-17 08:55:08 +00:00
|
|
|
pull_request:
|
2022-02-28 15:27:28 +00:00
|
|
|
paths:
|
2022-03-30 18:45:35 +00:00
|
|
|
- "flake.nix"
|
|
|
|
- "flake.lock"
|
|
|
|
- "frontend/**"
|
2022-02-28 15:27:28 +00:00
|
|
|
- "VERSION"
|
|
|
|
|
2020-04-10 09:04:03 +00:00
|
|
|
push:
|
|
|
|
branches:
|
2020-12-18 13:02:36 +00:00
|
|
|
- main
|
2022-02-28 15:27:28 +00:00
|
|
|
|
2020-04-10 09:04:03 +00:00
|
|
|
jobs:
|
|
|
|
build-and-deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checking out the repository
|
2022-03-02 11:05:42 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-06-18 22:41:01 +00:00
|
|
|
|
2022-02-27 23:10:09 +00:00
|
|
|
- name: Setup
|
|
|
|
uses: ./.github/actions/common-setup
|
2020-08-28 20:57:06 +00:00
|
|
|
with:
|
2022-10-29 20:58:44 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-02-27 23:10:09 +00:00
|
|
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
|
|
|
|
2022-02-28 15:16:33 +00:00
|
|
|
|
2020-08-28 20:57:06 +00:00
|
|
|
|
2020-04-10 09:04:03 +00:00
|
|
|
- name: Building search.nixos.org
|
2020-05-08 22:44:52 +00:00
|
|
|
run: |
|
2022-01-17 11:18:00 +00:00
|
|
|
nix -vL build .#frontend
|
2020-06-12 12:29:04 +00:00
|
|
|
mkdir ./dist
|
|
|
|
cp -RL ./result/* ./dist/
|
2020-06-18 22:41:01 +00:00
|
|
|
|
2020-04-10 09:04:03 +00:00
|
|
|
- name: Deploy to Netlify
|
2023-02-07 15:33:14 +00:00
|
|
|
uses: nwtgck/actions-netlify@v2.0
|
2020-04-10 09:04:03 +00:00
|
|
|
env:
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
|
|
with:
|
2020-12-18 13:02:36 +00:00
|
|
|
production-branch: 'main'
|
2021-08-17 08:55:08 +00:00
|
|
|
production-deploy: ${{ github.event_name == 'push' }}
|
2020-04-10 09:04:03 +00:00
|
|
|
publish-dir: './dist'
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
deploy-message: 'Deploy from GitHub Actions'
|
2020-12-18 13:02:36 +00:00
|
|
|
enable-pull-request-comment: true
|
2022-04-21 07:12:19 +00:00
|
|
|
overwrites-pull-request-comment: true
|
|
|
|
enable-commit-comment: false
|
2020-12-18 13:02:36 +00:00
|
|
|
enable-commit-status: true
|
2022-03-30 18:45:35 +00:00
|
|
|
if: github.repository_owner == 'NixOS'
|