Skip to content

Commit

Permalink
Update CI to deploy temporary doc for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailrun committed Oct 1, 2024
1 parent 53fff5a commit c79194f
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/ci_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ on:
- main
- ext/**
workflow_dispatch:

permissions:
actions: write
contents: write

env:
REGISTRY: "ghcr.io"
IMAGE_TAG: "beluga-lang/mcltt:main"

jobs:
wf:
Expand All @@ -33,24 +25,22 @@ jobs:
name: Continuous Intergration
runs-on: ubuntu-latest
permissions:
actions: write
packages: read
contents: write
env:
REGISTRY: "ghcr.io"
IMAGE_TAG: "beluga-lang/mcltt:main"
# Only deploy if the build follows from pushing to one of main branches
DOC_DEPLOY: ${{ (github.ref_name == 'main' || startsWith(github.ref_name, 'ext/')) && 'true' || 'false' }}
DOC_DEPLOY_DEST: ${{ startsWith(github.ref_name, 'ext/') && github.ref_name || '' }}
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Checkout repo
uses: actions/checkout@v4

- name: Initialise variables
run: |
# Only deploy if the build follows from pushing to master
if [[ '${{ github.ref }}' == 'refs/heads/main' ]]; then
echo "DOC_DEPLOY=true" >> $GITHUB_ENV
else
echo "DOC_DEPLOY=false" >> $GITHUB_ENV
fi

- name: Log in container registry
uses: docker/login-action@v3
Expand Down Expand Up @@ -106,8 +96,9 @@ jobs:
run: sudo chown -R 1001:116 .

- name: Deploy GitHub pages
uses: JamesIves/github-pages-deploy-action@v4.6.8
if: ${{ success() && env.DOC_DEPLOY == 'true' }}
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ env.DOC_DEPLOY == 'true' }}
with:
branch: gh-pages
folder: html
target-folder: ${{ env.DOC_DEPLOY_DEST }}
clean-exclude: ext

0 comments on commit c79194f

Please sign in to comment.