Skip to content

Commit

Permalink
ci: Consolidate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzleutgeb committed Apr 17, 2024
1 parent 3ef8975 commit d059e56
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
with:
extra-conf: |
experimental-features = no-url-literals
- run: nix ${{ runner.debug && '--debug' }} flake check --impure --no-build --show-trace
env:
NIX_ABORT_ON_WARN: true
Expand All @@ -37,44 +36,27 @@ jobs:
with:
name: ngi
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- id: env
run: echo "CACHIX_AUTH_TOKEN=$(tr 'A-Za-z' 'N-ZA-Mn-za-m' < .github/workflows/cachix)" >> $GITHUB_ENV
if: steps.trusted.outcome == 'skipped'

- name: Cachix using untrusted cache for PRs from forks
uses: cachix/cachix-action@v14
if: steps.env.outcome == 'success'
with:
name: ngi-untrusted
extraPullNames: ngi
authToken: ${{ env.CACHIX_AUTH_TOKEN }}

- run: nix ${{ runner.debug && '--debug --print-build-logs' }} flake check

overview:
if: github.event_name != 'pull_request'
needs: check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
experimental-features = no-url-literals
- uses: cachix/cachix-action@v14
with:
name: ngi
skipPush: true
- run: nix ${{ runner.debug && '--debug --print-build-logs' }} build .#overview
if: github.event_name != 'pull_request'
- uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
with:
path: result

deploy:
if: github.event_name != 'pull_request'
needs: overview
needs: check
runs-on: ubuntu-22.04
permissions:
contents: read
Expand All @@ -85,4 +67,4 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4

0 comments on commit d059e56

Please sign in to comment.