Skip to content

Commit

Permalink
attempt to fix 2.4.2 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascantor authored Apr 5, 2024
1 parent 871173b commit 5e26ae0
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Eleventy site and deploy it to GitHub Pages
name: Deploy Eleventy site to GitHub Pages

on:
# Runs on pushes targeting the master branch
Expand All @@ -24,22 +24,44 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine packager manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'node'
check-latest: true

node-version: '16'
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Install dependencies & build
run: |
npm install
npm run build-gh-pages
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.eleventy/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-eleventy-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-eleventy-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build
run: ${{ steps.detect-package-manager.outputs.manager }} run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down

0 comments on commit 5e26ae0

Please sign in to comment.