Skip to content

Commit

Permalink
build: rename github action file to be detected by github Pages confi…
Browse files Browse the repository at this point in the history
…guration
  • Loading branch information
marc-bouvier committed Jul 29, 2024
1 parent c002b1b commit 466712d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 82 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/deploy-to-ghpages.yml

This file was deleted.

74 changes: 39 additions & 35 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
name: Deploy to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
branches:
- main
pull_request:

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Persist npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: "${{ runner.os }}-node-${{ hashFiles('**/package.json') }}"

- name: Persist Eleventy .cache
uses: actions/cache@v4
with:
path: ./.cache
key: ${{ runner.os }}-eleventy-fetch-cache

- name: Install dependencies
run: npm install

- name: Build static site
run: npm run build:gh-pages

- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site

0 comments on commit 466712d

Please sign in to comment.