Build and deploy documentation on GitHub Pages #3
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: Build and deploy documentation on GitHub Pages | |
on: | |
page_build | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add zip file download links to the installation instructions | |
run: | | |
RELEASE_TAG=$(git describe --tags --abbrev=0 --match=v*.*.*) | |
echo $RELEASE_TAG | |
URL="https://github.com/Stardown-app/Stardown/releases/download/${RELEASE_TAG}/stardown-${RELEASE_TAG}" | |
echo $URL | |
cat docs/install-and-update-instructions/script.js \ | |
| sed s,\<a\ class=\"firefox\",\<a\ href=\"$URL-firefox.zip\", \ | |
| sed s,\<a\ class=\"chrome\",\<a\ href=\"$URL-chrome.zip\", \ | |
| tee docs/install-and-update-instructions/script.js >/dev/null | |
- name: Set up GitHub Pages | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |