Skip to content

Commit

Permalink
ci: support multiple pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Randoooom committed Mar 17, 2024
1 parent 1c07439 commit 2b0da7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Nightly

on:
workflow_dispatch:
schedule:
- cron: '0 0 */2 * *'
push:
branches:
- main
Expand Down Expand Up @@ -145,12 +147,24 @@ jobs:
command: install
args: cargo-make

- name: Download current pages artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: ./

- name: Extract pages artifact
run: mkdir pages/ && tar -xvf artifact.tar -C pages/

- name: Build docs
uses: actions-rs/cargo@v1
with:
command: make
args: docs_build

- name: Prefix docs
run: mkdir -p pages/nightly/ && mv -f target/docs/ pages/nightly/docs/

- name: Fix permissions
run: |
chmod -c -R +rX "pages/" | while read line; do
Expand All @@ -161,16 +175,17 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
path: pages/
retention-days: 3

deploy-docs:
deploy-pages:
needs: [ build-docs, test ]
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}nightly
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to pages
id: deployment
Expand Down
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ args = [
[tasks.docs_build]
dependencies = ["docs_lint"]
command = "npx"
args = ["redocly", "build-docs", "target/openapi.yaml", "-o", "pages/docs/http/index.html"]
args = ["redocly", "build-docs", "target/openapi.yaml", "-o", "target/docs/http/index.html"]

# bindings

Expand Down

0 comments on commit 2b0da7b

Please sign in to comment.