Release #97
This file contains 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: Release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0" # At 00:00 on Sunday (weekly) | |
env: | |
BASE: / | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Code | |
uses: actions/checkout@v3 | |
- name: Update package archive | |
run: sudo apt-get update | |
- name: Install NodeGit Build Dependencies | |
run: sudo apt install libkrb5-dev | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 7.25.1 | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 14 | |
cache: pnpm | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Initialize asterics-docs | |
run: pnpm run docs init --no-reference | |
- name: Setup docs | |
run: pnpm run docs setup | |
- name: Build | |
env: | |
NODE_OPTIONS: "--max-old-space-size=12288" | |
run: pnpm run build | |
- name: Upload Build Result | |
uses: actions/upload-artifact@v3 | |
with: | |
name: asterics-docs | |
path: dist | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download Build Result | |
uses: actions/download-artifact@v3 | |
with: | |
name: asterics-docs | |
path: asterics-docs | |
- name: Get Code (gh-pages) | |
uses: actions/checkout@v3 | |
with: | |
ref: "gh-pages" | |
path: "gh-pages" | |
- name: Merge Builds | |
run: | | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "" | |
mv gh-pages/next next | |
rm -rf gh-pages/* | |
cp -r asterics-docs/* gh-pages/ | |
mv next gh-pages/next | |
echo "www.asterics.eu" > gh-pages/CNAME | |
git --git-dir=gh-pages/.git --work-tree=gh-pages/ add . | |
git --git-dir=gh-pages/.git --work-tree=gh-pages/ commit -m "docs: release" | |
- name: Upload to GitHub | |
run: git --git-dir=gh-pages/.git --work-tree=gh-pages/ push | |
# We don't know when the site will be deployed, we just wait a few seconds | |
# Better solutions can be found | |
delay: | |
needs: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delay for 120 seconds | |
run: sleep 120s | |
index: | |
needs: [deploy, delay] | |
uses: ./.github/workflows/algolia.yml | |
with: | |
delete_index: true | |
secrets: inherit |