Fix use master branch when building dev version #11
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: builder | |
on: | |
push: | |
branches: | |
- docs | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Checkout (for dev) | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
path: 'dev' | |
- name: Build dev version | |
run: | | |
mkdir -p dev/fonts | |
pushd dev | |
pushd fonts | |
wget "https://github.com/sandorex/compacity-fonts/releases/download/DEV/CompacityFonts.zip" | |
unzip *.zip | |
rm *.zip | |
popd # fonts | |
npm install | |
npm run gen | |
# remove bloat | |
rm -rf node_modules | |
popd # dev | |
- name: Build latest release | |
run: | | |
mkdir -p fonts | |
# build the latest release | |
pushd fonts/ | |
wget "https://github.com/sandorex/compacity-fonts/releases/latest/download/CompacityFonts.zip" | |
unzip *.zip | |
rm *zip | |
popd | |
npm install | |
npm run gen | |
# remove bloat | |
rm -rf node_modules | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: '.' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |