Skip to content

Deploy

Deploy #3

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
permissions:
contents: read
id-token: write
pages: write
jobs:
get-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: pages
fetch-depth: 0
- name: Get versions
id: versions
run: echo "versions=$(git branch -r --format '%(refname:lstrip=3)' | sed -nr 's/version\/(.+)/\1/p' | jq -cRn '[inputs]')" >> "$GITHUB_OUTPUT"
get-artifacts:
needs:
- get-versions
runs-on: ubuntu-latest
strategy:
matrix:
version: ${{ fromJson(needs.get-versions.outputs.versions) }}
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v3
with:
workflow: build.yml
branch: ${{ format('version/{0}', matrix.version) }}
name: build
name_is_regexp: false
path: build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.version }}
path: build
retention-days: 1
deploy:
needs:
- get-artifacts
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: pages
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create home page
run: python3 deploy.py
- name: Setup pages
uses: actions/configure-pages@v5
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy pages
id: deployment
uses: actions/deploy-pages@v4