Merge pull request #160 from Stardown-app/fix-misc #5
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: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
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 |