Skip to content

Commit

Permalink
Update push_build.yml
Browse files Browse the repository at this point in the history
Update outdated actions.
  • Loading branch information
eatyourgreens committed Dec 11, 2023
1 parent b2a634a commit e58cd86
Showing 1 changed file with 31 additions and 16 deletions.
47 changes: 31 additions & 16 deletions .github/workflows/push_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,45 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-18.04
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: 'lts/iron'
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run build
- run: npx eleventy

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: upload files
uses: actions/upload-pages-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _site
path: dist

deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3 # or the latest "vX.X.X" version tag for this action

0 comments on commit e58cd86

Please sign in to comment.