Skip to content

Commit

Permalink
Use GitHub Action for deploy
Browse files Browse the repository at this point in the history
cy-by committed Jun 8, 2024
1 parent 6c5fbc2 commit b27ea6b
Showing 3 changed files with 47 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/deploy-to-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
pull_request:

jobs:
deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"

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

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

- run: npm install
- run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
_drafts/
_site/
.cache
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"install": "npx install",
"serve": "npx @11ty/eleventy --serve"
"serve": "npx @11ty/eleventy --serve",
"build": "npx @11ty/eleventy"
},
"author": "",
"license": "ISC",

0 comments on commit b27ea6b

Please sign in to comment.