From 6554dab3237d666dd69ef9e615756e97f84c6292 Mon Sep 17 00:00:00 2001 From: Datseris Date: Sat, 14 Oct 2023 13:49:23 +0200 Subject: [PATCH] add updated GitHub workflow files --- .github/workflows/TagBot.yml | 8 ++++---- .github/workflows/ci.yml | 32 ++++------------------------- .github/workflows/doccleanup.yml | 26 +++++++++++++++++++++++ .github/workflows/documentation.yml | 26 +++++++++++++++++++++++ 4 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/doccleanup.yml create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index 198db410..623860f7 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,15 +1,15 @@ -name: Julia TagBot +name: TagBot on: issue_comment: types: - created + workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - - uses: JuliaRegistries/TagBot@v1.10.0 + - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - ssh: ${{ secrets.DOCUMENTER_KEY }} - + ssh: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e13e909..6278b77a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,33 +45,9 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - docs: - name: Documentation - runs-on: ubuntu-latest - steps: - # Cancel ongoing documentation build if pushing to branch again before the previous - # build is finished. - - name: Cancel ongoing documentation builds for previous commits - uses: styfle/cancel-workflow-action@0.6.0 - with: - access_token: ${{ github.token }} - - # Build docs - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 with: - version: '1' - - name: Instantiate and install dependencies - run: | - julia --project=docs -e ' - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate()' - - name: Generate documentation and deploy - env: # needed for pushing to gh-pages branch - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - run: - julia --project=docs docs/make.jl \ No newline at end of file + file: lcov.info diff --git a/.github/workflows/doccleanup.yml b/.github/workflows/doccleanup.yml new file mode 100644 index 00000000..22d90435 --- /dev/null +++ b/.github/workflows/doccleanup.yml @@ -0,0 +1,26 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v2 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "previews/PR$PRNUM" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "previews/PR$PRNUM" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi + env: + PRNUM: ${{ github.event.number }} \ No newline at end of file diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 00000000..33e080c7 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,26 @@ +name: Documentation + +on: + push: + branches: + - main + tags: '*' + pull_request: + +jobs: + build: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key + run: julia --project=docs/ docs/make.jl \ No newline at end of file