Merge pull request #4732 from tridactyl/host_docs

Host docs
This commit is contained in:
Oliver Blanthorn 2023-07-02 15:11:19 +00:00 committed by GitHub
commit 440bf53eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

58
.github/workflows/website.yml vendored Normal file
View file

@ -0,0 +1,58 @@
name: CI
# 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" ]
pull_request:
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
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: |
yarn install
yarn run build
find . -iname "*.html" -exec sed 's@href="/static@href="/tridactyl/public/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