tridactyl/.github/workflows/website.yml
2023-07-31 23:17:40 +05:30

58 lines
1.8 KiB
YAML

name: Website
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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
with:
repository: 'tridactyl/tridactyl'
path: 'tridactyl'
- uses: actions/checkout@v3
with:
repository: 'tridactyl/site'
submodules: 'recursive' # we shouldn't need this, public should be generated each time
path: 'site'
- name: Build
run: |
cd tridactyl
yarn install
yarn run build
find . -iname "*.html" -exec sed 's@href="/static@href="/build/static@' -i '{}' ';' # ideally this url would be less gnarly
cd ../site
sudo apt-get install -y hugo
hugo
cp -r ../tridactyl/build/ public
- uses: actions/upload-pages-artifact@v1
with:
path: 'site/public'
retention-days: 2
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2