Skip to content

Commit

Permalink
ci: update to docusaurus official action
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadrien Froger committed Sep 4, 2024
1 parent aaaa5b8 commit 3094518
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 11 deletions.
56 changes: 47 additions & 9 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
name: CI
on: [push]
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
deploy:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: redkubes/[email protected]
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
working-directory: website
run: yarn install --frozen-lockfile

- name: Build website
working-directory: website
run: yarn build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
source-folder: website
git-user: ${{ github.actor }}
git-password: ${{ secrets.GITHUB_TOKEN }}
deployment-branch: gh-pages
path: website/build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
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@v4
5 changes: 3 additions & 2 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ const config: Config = {
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
trailingSlash: false,

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'octree', // Usually your GitHub org/user name.
organizationName: 'octree-gva', // Usually your GitHub org/user name.
projectName: 'decidim-decidim_geo', // Usually your repo name.

onBrokenLinks: 'throw',
Expand Down Expand Up @@ -88,7 +89,7 @@ const config: Config = {
items: [
{
label: 'Documentation',
to: '/docs/intro',
to: '//',
},
],
},
Expand Down

0 comments on commit 3094518

Please sign in to comment.