From 56e6c48322c64572c692fe6b2b5dd03da223f7da Mon Sep 17 00:00:00 2001 From: Ayush Gupta Date: Thu, 13 Aug 2026 21:04:29 +0530 Subject: [PATCH] chore: deploy pages for handbook --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cb5b17..3f3bdfb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,12 +8,16 @@ on: type: string permissions: contents: write + pages: write + id-token: write concurrency: group: release-${{ inputs.version }} cancel-in-progress: false jobs: release: runs-on: ubuntu-latest + outputs: + pdf-name: handbook-${{ inputs.version }}.pdf steps: - name: checkout. uses: actions/checkout@v4 @@ -50,3 +54,49 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create "${{ inputs.version }}" "handbook-${{ inputs.version }}.pdf" --title "${{ inputs.version }}" --generate-notes + - name: upload pdf for pages job. + uses: actions/upload-artifact@v4 + with: + name: handbook-pdf + path: handbook-${{ inputs.version }}.pdf + retention-days: 1 + + deploy-pages: + needs: release + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: download pdf from release job. + uses: actions/download-artifact@v4 + with: + name: handbook-pdf + path: site-src + - name: build site. + run: | + mkdir -p site + cp "site-src/handbook-${{ inputs.version }}.pdf" "site/handbook.pdf" + cp "site-src/handbook-${{ inputs.version }}.pdf" "site/handbook-${{ inputs.version }}.pdf" + cat > site/index.html < + + + + Analog Blocks - Ayush Gupta - ${{ inputs.version }} + + + +

Redirecting to the latest handbook (${{ inputs.version }}).

+ + + EOF + + echo "eeng.isitayush.dev" > site/CNAME + - name: upload pages artifact. + uses: actions/upload-pages-artifact@v3 + with: + path: site + - name: deploy to github pages. + id: deployment + uses: actions/deploy-pages@v4