From 2a64e9ff0271a5a7414a89670871ac6ef8660677 Mon Sep 17 00:00:00 2001 From: glacambre Date: Sat, 1 Jul 2023 18:29:49 +0200 Subject: [PATCH] Build Tridactyl website with docs --- .github/workflows/website.yml | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/website.yml diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 00000000..e68a945c --- /dev/null +++ b/.github/workflows/website.yml @@ -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