feat(ci): Merge all workflows into one file

This commit is contained in:
Jalil David Salamé Messina 2024-02-18 16:51:03 +01:00
parent 3c71af1950
commit 465268c194
Signed by: jalil
GPG key ID: F016B9E770737A0B
2 changed files with 28 additions and 34 deletions

View file

@ -20,12 +20,39 @@ jobs:
- name: Run `nix flake check` - name: Run `nix flake check`
run: nix flake check run: nix flake check
lockfile: lockfile:
runs-on: ubuntu-22.04
needs: check needs: check
if: ${{ github.event_name == 'schedule' }} # only run when scheduled if: ${{ github.event_name == 'schedule' }} # only run when scheduled
runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v9 - uses: DeterminateSystems/nix-installer-action@v9
- uses: DeterminateSystems/update-flake-lock@v20 - uses: DeterminateSystems/update-flake-lock@v20
- name: Run `nix flake check` - name: Run `nix flake check`
run: nix flake check run: nix flake check
build-documentation:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }} # only run when not scheduled
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v9
- uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Build documentation
run: nix build .#docs --print-build-logs
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./result
deploy:
runs-on: ubuntu-latest
needs: build-documentation
if: ${{ github.event_name == 'push' && github.ref == 'main' }} # only run triggered by a push on main
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View file

@ -1,33 +0,0 @@
name: Deploy Documentation
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v9
- uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Build documentation
run: nix build .#docs --print-build-logs
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./result
deploy:
needs: build-website
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2