buildTileUrlTemplate
supports async functions
#148
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: Deploy Website | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
concurrency: | |
group: "deploy" | |
jobs: | |
deploy-branch: | |
if: startsWith(github.ref, 'refs/heads/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build Website | |
run: ./tasks/build-website.sh -l $(node tasks/get-latest-release.js) | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
clean: false | |
- name: Commit to GitHub Pages | |
run: | | |
cp -r build/site/* . | |
if [ -n "$(git status --porcelain)" ]; then | |
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
git add . | |
git commit -m "Website updates" | |
git push origin gh-pages | |
fi | |
deploy-tag: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Assert Latest Release | |
run: node tasks/newest-tag.js --tag ${GITHUB_REF_NAME} | |
- name: Build Website | |
run: ./tasks/build-website.sh -l ${GITHUB_REF_NAME} -v ${GITHUB_REF_NAME} | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
clean: false | |
- name: Commit to GitHub Pages | |
run: | | |
cp -r build/site/* . | |
if [ -n "$(git status --porcelain)" ]; then | |
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
git add . | |
git commit -m "Website updates" | |
git push origin gh-pages | |
fi |