chore(deps): update #416
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy danieletabellini 11ty pages | |
on: | |
push: | |
branches: ['main'] | |
# pull_request: | |
# branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
- name: Install dependencies & build | |
run: | | |
# npm ci | |
npm install | |
npm run build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_dir: ./_site | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Configure GitHub Pages | |
uses: actions/[email protected] | |
with: | |
# Optional static site generator to attempt to configure: "nuxt", "next", "gatsby", or "sveltekit" | |
# static_site_generator: # optional | |
# Optional file path to static site generator configuration file | |
# generator_config_file: # optional | |
# GitHub token | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Try to enable Pages for the repository if it is not already enabled. | |
# This option requires a token other than `GITHUB_TOKEN` to be provided. | |
# In the context of a Personal Access Token, the `repo` scope or Pages | |
# write permission is required. In the context of a GitHub App, the | |
# `administration:write` and `pages:write` permissions are required. | |
# enablement: # optional, default is false | |
- name: Upload GitHub Pages artifact | |
uses: actions/[email protected] | |
with: | |
name: github-pages | |
path: ./_site | |
# retention-days: # optional, default is 1 | |
- name: Deploy GitHub Pages site | |
uses: actions/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifact_name: github-pages |