|
| 1 | +# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
| 2 | +name: Deploy Jekyll with GitHub Pages dependencies preinstalled |
| 3 | + |
| 4 | +on: |
| 5 | + # Runs on pushes targeting the default branch |
| 6 | + push: |
| 7 | + branches: ["main"] |
| 8 | + |
| 9 | + # Allows you to run this workflow manually from the Actions tab |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 19 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 20 | +concurrency: |
| 21 | + group: "pages" |
| 22 | + cancel-in-progress: false |
| 23 | + |
| 24 | +jobs: |
| 25 | + # Build job |
| 26 | + build: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v4 |
| 31 | + - name: Setup Pages |
| 32 | + uses: actions/configure-pages@v5 |
| 33 | + - name: Build with Jekyll |
| 34 | + uses: actions/jekyll-build-pages@v1 |
| 35 | + with: |
| 36 | + source: ./ |
| 37 | + destination: ./_site |
| 38 | + - name: Upload artifact |
| 39 | + uses: actions/upload-pages-artifact@v3 |
| 40 | + |
| 41 | + # Deployment job |
| 42 | + deploy: |
| 43 | + environment: |
| 44 | + name: github-pages |
| 45 | + url: ${{ steps.deployment.outputs.page_url }} |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: build |
| 48 | + steps: |
| 49 | + - name: Deploy to GitHub Pages |
| 50 | + id: deployment |
| 51 | + uses: actions/deploy-pages@v4 |
| 52 | + - name: Setup Node.js environment |
| 53 | + uses: actions/setup-node@v5.0.0 |
| 54 | + with: |
| 55 | + # Set always-auth in npmrc. |
| 56 | + always-auth: # optional, default is false |
| 57 | + # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. |
| 58 | + node-version: # optional |
| 59 | + # File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions. |
| 60 | + node-version-file: # optional |
| 61 | + # Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default. |
| 62 | + architecture: # optional |
| 63 | + # Set this option if you want the action to check for the latest available version that satisfies the version spec. |
| 64 | + check-latest: # optional |
| 65 | + # Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN. |
| 66 | + registry-url: # optional |
| 67 | + # Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). |
| 68 | + scope: # optional |
| 69 | + # Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. |
| 70 | + token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} |
| 71 | + # Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm. |
| 72 | + cache: # optional |
| 73 | + # Set to false to disable automatic caching based on the package manager field in package.json. By default, caching is enabled if the package manager field is present. |
| 74 | + package-manager-cache: # optional, default is true |
| 75 | + # Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies. |
| 76 | + cache-dependency-path: # optional |
| 77 | + # Used to specify an alternative mirror to downlooad Node.js binaries from |
| 78 | + mirror: # optional |
| 79 | + # The token used as Authorization header when fetching from the mirror |
| 80 | + mirror-token: # optional |
| 81 | + |
0 commit comments