From 2de7fe1c13ae2d71b1003162cb6a24c37709f2a8 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 12 Jul 2023 18:28:45 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20chore(deploy=5Fgh-pages.yml):=20?= =?UTF-8?q?add=20GitHub=20Actions=20workflow=20to=20deploy=20to=20GitHub?= =?UTF-8?q?=20Pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a new GitHub Actions workflow file, `deploy_gh-pages.yml`, which is responsible for deploying the project to GitHub Pages. The workflow is triggered on pushes to the `lf-docs-fix` branch. The workflow consists of the following steps: 1. Checkout the repository 2. Set up Node.js environment with version 18 and npm caching 3. Install dependencies for the documentation 4. Build the website 5. Deploy the built website to GitHub Pages using the `peaceiris/actions-gh-pages` action - The deployment is done to the `gh-pages` branch - The build output is published from the `./docs/build` directory - The commit authorship is assigned to the official GH-Actions bot This workflow enables automatic deployment of the documentation to GitHub Pages whenever changes are pushed to the `lf-docs-fix` branch. --- .github/workflows/deploy_gh-pages.yml | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/deploy_gh-pages.yml diff --git a/.github/workflows/deploy_gh-pages.yml b/.github/workflows/deploy_gh-pages.yml new file mode 100644 index 000000000..ebb05059e --- /dev/null +++ b/.github/workflows/deploy_gh-pages.yml @@ -0,0 +1,38 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - lf-docs-fix + # Review gh actions docs if you want to further define triggers, paths, etc + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on + +jobs: + deploy: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + + - name: Install dependencies + run: cd docs && npm install + - name: Build website + run: cd docs && npm run build + + # Popular action to deploy to GitHub Pages: + # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Build output to publish to the `gh-pages` branch: + publish_dir: ./docs/build + # The following lines assign commit authorship to the official + # GH-Actions bot for deploys to `gh-pages` branch: + # https://github.com/actions/checkout/issues/13#issuecomment-724415212 + # The GH actions bot is used by default if you didn't specify the two fields. + # You can swap them out with your own user credentials.