Skip to content

Commit

Permalink
Update build pipeline (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
melund authored Feb 28, 2024
1 parent 427538b commit 01247f2
Show file tree
Hide file tree
Showing 2 changed files with 2,079 additions and 3,722 deletions.
28 changes: 8 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
tags: ["*"]
pull_request:
branches: [ master ]
workflow_dispatch:


jobs:
Expand All @@ -21,7 +22,7 @@ jobs:
fetch-depth: 0

- id: find-tag
run: echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> "$GITHUB_OUTPUT"
run: echo "tag=$(git describe --tags `git rev-list --tags=tutorials-* --max-count=1`)" >> "$GITHUB_OUTPUT"


link-check:
Expand All @@ -30,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: prefix-dev/setup-pixi@v0.4.1
- uses: prefix-dev/setup-pixi@v0.5.1
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
Expand All @@ -47,7 +48,7 @@ jobs:
with:
ref: ${{ needs.find-tag.outputs.latest-tag }}

- uses: prefix-dev/setup-pixi@v0.4.1
- uses: prefix-dev/setup-pixi@v0.5.1
continue-on-error: true
id: pixisetup
with:
Expand Down Expand Up @@ -80,7 +81,7 @@ jobs:
with:
fetch-depth: 0

- uses: prefix-dev/setup-pixi@v0.4.1
- uses: prefix-dev/setup-pixi@v0.5.1
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
Expand All @@ -105,29 +106,15 @@ jobs:
ref: ${{ needs.find-tag.outputs.latest-tag }}
fetch-depth: 0

- uses: prefix-dev/setup-pixi@v0.4.1
continue-on-error: true
id: pixisetup
- uses: prefix-dev/setup-pixi@v0.5.1
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}

- name: Build Documentation
if: steps.pixisetup.outcome == 'success'
run: pixi run sphinx-build -M html . _build -W --keep-going -a


- name: Install mamba
if: steps.pixisetup.outcome == 'failure'
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yaml

- name: build with mamba
if: steps.pixisetup.outcome == 'failure'
shell: bash -leo pipefail {0} {0}
run: sphinx-build -M html . _build -W --keep-going -a

- uses: actions/upload-artifact@v3
with:
name: tagged-version
Expand All @@ -153,7 +140,8 @@ jobs:

deploy:
needs: prepare-pages
if: github.ref == 'refs/heads/master'
# only run if master branch or if tag containing "tutorials-*" is pushed
if: github.ref == 'refs/heads/master' || contains(github.ref, 'tags/tutorials-')
runs-on: ubuntu-latest
permissions:
pages: write
Expand Down
Loading

0 comments on commit 01247f2

Please sign in to comment.