New version release #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: New version release | |
description: Bump version, push to IPFS, and create GitHub Release | |
on: | |
workflow_dispatch: | |
inputs: | |
release-type: | |
description: 'Type of version bump' | |
required: true | |
default: patch | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
name: Build & export static site | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Build and Export | |
run: npm run docs:build | |
- name: Upload export as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aleph-cloud-docs-export | |
path: ./docs/.vitepress/dist | |
if-no-files-found: error | |
retention-days: 1 | |
push-to-ipfs: | |
name: Push site to IPFS | |
needs: build | |
runs-on: ubuntu-22.04 | |
outputs: | |
cid_v0: ${{ steps.push_to_ipfs.outputs.cid_v0 }} | |
cid_v1: ${{ steps.push_to_ipfs.outputs.cid_v1 }} | |
steps: | |
- name: Download export artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: aleph-cloud-docs-export | |
path: dist | |
- name: Push to IPFS | |
id: push_to_ipfs | |
uses: aleph-im/aleph-github-actions/[email protected] | |
with: | |
upload-dir: dist | |
deploy-app: | |
name: Deploy to production | |
needs: push-to-ipfs | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
pip install -r scripts/deploy/requirements.txt | |
shell: bash | |
- name: Deploy to Aleph | |
run: | | |
python scripts/deploy/client.py \ | |
--cid ${{ needs.push-to-ipfs.outputs.cid_v0 }} \ | |
--app ${{ vars.DEPLOY_APP }} \ | |
--url ${{ vars.DEPLOY_URL }} \ | |
--key ${{ secrets.DEPLOY_PRIVATE_KEY }} |