From 9b6e6c9ad0444b228ee3ac02e3c4b0ca88fdf4fa Mon Sep 17 00:00:00 2001 From: inky Date: Tue, 6 Feb 2024 15:34:15 -0600 Subject: [PATCH] ci: fix doc deploy (#561) * ci: fix doc deploy * ci: allow Skip intermediate builds --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ef39b8d..cd46ea50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,13 @@ on: branches: - master tags: '*' + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -48,23 +55,31 @@ jobs: docs: name: Documentation runs-on: ubuntu-latest + permissions: + # needed to allow julia-actions/cache to proactively delete old caches that it has created + actions: write + contents: write steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: '1' - - run: | - julia --project=docs -e ' - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate()' - - run: | - julia --project=docs -e ' - using Documenter: doctest, DocMeta - using Polynomials - DocMeta.setdocmeta!(Polynomials, :DocTestSetup, :(using Polynomials); recursive = true) - doctest(Polynomials)' - - run: julia --project=docs docs/make.jl + - uses: julia-actions/cache@v1 + - name: Configure doc environment + shell: julia --project=docs --color=yes {0} + run: | + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate() + - name: Run doctests + shell: julia --project=docs --color=yes {0} + run: | + using Documenter: DocMeta, doctest + using Polynomials + DocMeta.setdocmeta!(Polynomials, :DocTestSetup, :(using Polynomials); recursive=true) + doctest(Polynomials) + - uses: julia-actions/julia-buildpkg@v1 + - name: Deploy + run: julia --project=docs docs/make.jl env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file