mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Build Tridactyl website with docs
This commit is contained in:
parent
5eaab1046f
commit
2a64e9ff02
1 changed files with 60 additions and 0 deletions
60
.github/workflows/website.yml
vendored
Normal file
60
.github/workflows/website.yml
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
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: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
# 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/site'
|
||||
submodules: 'recursive'
|
||||
path: 'site'
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'tridactyl/tridactyl'
|
||||
path: 'tridactyl'
|
||||
- name: Build
|
||||
run: |
|
||||
cd tridactyl
|
||||
yarn install
|
||||
yarn run build
|
||||
find . -iname "*.html" -exec sed 's@href="/static@href="/tridactyl-docs/public/build/static@' -i '{}' ';'
|
||||
cd ../site
|
||||
sudo apt-get install -y hugo
|
||||
hugo
|
||||
cp -r ../tridactyl/build/ public
|
||||
- uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
path: 'site'
|
||||
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
|
Loading…
Add table
Reference in a new issue