Merge pull request #1086 from mendhak/milestone128 #16
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 Publish Github Pages | |
# Trigger this workflow only when the main branches, assets folder is modified. | |
on: | |
push: | |
branches: [ "main", "master" ] | |
paths: | |
- 'assets/**' | |
- 'LICENSE.md' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
deployments: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
defaults: | |
run: | |
working-directory: assets/generate-pages | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Layer caching | |
uses: satackey/[email protected] | |
# Ignore the failure of a step and avoid terminating the job. | |
continue-on-error: true | |
- name: Build the static site | |
run: docker-compose run --rm --entrypoint "/bin/bash -c 'npm install;npx eleventy'" eleventy | |
# - name: Test the generated pages | |
# run: | | |
# mkdir -p smashtest | |
# chmod -R a+rw smashtest | |
# npm install smashtest | |
# npx smashtest | |
# | |
# - name: Upload Smashtest Report Artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: smashtest-report | |
# path: assets/generate-pages/smashtest/ | |
- name: Setup Github Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload Github Pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'assets/generate-pages/_site' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |