player stats blog post #57
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 | |
# Trigger this workflow only when the main branches, assets folder is modified. | |
on: | |
push: | |
branches: [ "main", "master" ] | |
paths-ignore: | |
- '**/README.md' | |
- 'tests/**' | |
# 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 }} | |
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: jpribyl/action-docker-layer-caching@v0.1.1 | |
# Ignore the failure of a step and avoid terminating the job. | |
continue-on-error: true | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Build the static site | |
# If GH_GIST_TOKEN doesn't exist, empty value gets passed. | |
# Unauthenticated call gets made to Gist API which can result in rate limits, | |
# Especially in Github Actions | |
run: /bin/bash -c 'npm install;npm run build --gisttoken=${{ secrets.GH_GIST_TOKEN }} --githubtoken=${{ secrets.GITHUB_TOKEN }}' | |
- name: Setup Github Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload Github Pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |