tridactyl/.github/workflows/website.yml

59 lines
1.8 KiB
YAML
Raw Normal View History

2023-07-02 17:13:47 +02:00
name: Website
2023-07-01 18:29:49 +02:00
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
2023-07-01 18:52:35 +02:00
branches: [ "master" ]
2023-07-01 18:29:49 +02:00
# 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
2023-07-01 18:52:35 +02:00
- uses: actions/checkout@v3
2023-07-02 17:12:44 +02:00
with:
2023-07-01 20:10:35 +02:00
repository: 'tridactyl/tridactyl'
path: 'tridactyl'
2023-07-01 18:29:49 +02:00
- uses: actions/checkout@v3
with:
repository: 'tridactyl/site'
submodules: 'recursive' # we shouldn't need this, public should be generated each time
2023-07-01 18:29:49 +02:00
path: 'site'
- name: Build
run: |
2023-07-02 17:13:47 +02:00
cd tridactyl
2023-07-01 18:29:49 +02:00
yarn install
yarn run build
2023-07-02 17:40:40 +02:00
find . -iname "*.html" -exec sed 's@href="/static@href="/build/static@' -i '{}' ';' # ideally this url would be less gnarly
2023-07-01 18:29:49 +02:00
cd ../site
sudo apt-get install -y hugo
hugo
cp -r ../tridactyl/build/ public
- uses: actions/upload-pages-artifact@v1
with:
2023-07-01 18:52:35 +02:00
path: 'site/public'
2023-07-01 18:29:49 +02:00
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