|
| 1 | +# ----------------------------------------------------------------------------- |
| 2 | +# DO NOT EDIT! |
| 3 | +# Generated from xpacks/@xpack-dev-tools/xbb-helper/templates/workflows/*. |
| 4 | +# |
| 5 | +# This file is part of the xPack distribution. |
| 6 | +# (https://xpack.github.io) |
| 7 | +# Copyright (c) 2021 Liviu Ionescu. |
| 8 | +# |
| 9 | +# Permission to use, copy, modify, and/or distribute this software |
| 10 | +# for any purpose is hereby granted, under the terms of the MIT license. |
| 11 | +# ----------------------------------------------------------------------------- |
| 12 | + |
| 13 | +# Simple workflow for deploying static content to GitHub Pages |
| 14 | +name: GitHub Pages |
| 15 | + |
| 16 | +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows |
| 17 | +on: |
| 18 | + # Runs on pushes, if all conditions are met: |
| 19 | + push: |
| 20 | + # ... on the xpack branch ... |
| 21 | + branches: |
| 22 | + - 'xpack' |
| 23 | + # ... skip tags only ... |
| 24 | + tags-ignore: |
| 25 | + - '**' |
| 26 | + # ... any of these files changes ... |
| 27 | + paths: |
| 28 | + - 'website/**' |
| 29 | + - '.github/workflows/publish-github-pages.yml' |
| 30 | + - 'package.json' |
| 31 | + |
| 32 | + # Allows you to run this workflow manually from the Actions tab |
| 33 | + workflow_dispatch: |
| 34 | + |
| 35 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 36 | +permissions: |
| 37 | + contents: read |
| 38 | + pages: write |
| 39 | + id-token: write |
| 40 | + |
| 41 | +# Allow one concurrent deployment |
| 42 | +concurrency: |
| 43 | + group: "pages" |
| 44 | + cancel-in-progress: true |
| 45 | + |
| 46 | +jobs: |
| 47 | + # Single deploy job since we're just deploying |
| 48 | + deploy: |
| 49 | + environment: |
| 50 | + name: github-pages |
| 51 | + url: ${{ steps.deployment.outputs.page_url }} |
| 52 | + runs-on: ubuntu-latest |
| 53 | + |
| 54 | + steps: |
| 55 | + - name: Checkout |
| 56 | + # https://github.com/actions/checkout |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Use Nodejs |
| 60 | + # https://github.com/actions/setup-node |
| 61 | + uses: actions/setup-node@v4 |
| 62 | + with: |
| 63 | + node-version: 20 |
| 64 | + |
| 65 | + - name: Install dependencies |
| 66 | + run: npm install -C website |
| 67 | + |
| 68 | + - name: Generate Docusaurus |
| 69 | + run: npm run build -C website |
| 70 | + |
| 71 | + - name: Setup Pages |
| 72 | + # https://github.com/actions/configure-pages |
| 73 | + uses: actions/configure-pages@v5 |
| 74 | + |
| 75 | + - name: Upload artifact |
| 76 | + # https://github.com/actions/upload-pages-artifact |
| 77 | + uses: actions/upload-pages-artifact@v3 |
| 78 | + with: |
| 79 | + # Upload entire repository |
| 80 | + path: './website/build' |
| 81 | + |
| 82 | + - name: Deploy to GitHub Pages |
| 83 | + id: deployment |
| 84 | + # https://github.com/actions/deploy-pages |
| 85 | + uses: actions/deploy-pages@v4 |
0 commit comments