Skip to content

Publish GitHub Pages #69

Publish GitHub Pages

Publish GitHub Pages #69

Workflow file for this run

name: Publish GitHub Pages
# Controls when the action will run.
on:
workflow_dispatch:
inputs:
save_data_in_github_cache:
required: true
type: boolean
default: false
data_cache_prefix:
required: true
type: string
default: track_data
workflow_call:
inputs:
save_data_in_github_cache:
required: true
type: boolean
default: false
data_cache_prefix:
required: true
type: string
default: track_data
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Cache Data Files
if: inputs.save_data_in_github_cache
uses: actions/cache@v3
with:
path: |
activities
assets
GPX_OUT
TCX_OUT
FIT_OUT
Workouts
scripts/data.db
src/static/activities.json
imported.json
key: ${{ inputs.data_cache_prefix }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
${{ inputs.data_cache_prefix }}-${{ github.sha }}-
${{ inputs.data_cache_prefix }}-
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- run: |
yarn install
- run: |
PATH_PREFIX=/${{ github.event.repository.name }} yarn build --prefix-paths
- run: |
cp -r assets/ public/static
- name: GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
with:
# Git branch where site will be deployed
target_branch: gh-pages
# Create incremental commit instead of doing push force
keep_history: true
# Build directory to deploy
build_dir: public
# Write the given domain name to the CNAME file
#fqdn: custom.domain.name # optional
# Prevent Jekyll from building the site
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}