Skip to content

Commit

Permalink
Update GitHub Actions workflow to use peaceiris/actions-gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
prakashchokalingam committed Nov 21, 2024
1 parent a621dcc commit 3e83429
Showing 1 changed file with 16 additions and 35 deletions.
51 changes: 16 additions & 35 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,51 @@ on:
branches: ["main"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write
actions: write
deployments: 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
pull-requests: write
statuses: write
checks: write

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
pages: write
id-token: write
actions: write
deployments: write
pull-requests: write
statuses: write
checks: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Setup Pages
uses: actions/configure-pages@v4
with:
static_site_generator: next
enablement: true

- name: Install dependencies
run: npm ci

- name: Build with Next.js
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
actions: write
deployments: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: peaceiris/actions-gh-pages@v3
with:
enablement: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy to GitHub Pages'

0 comments on commit 3e83429

Please sign in to comment.