Skip to content

Commit 1e4274d

Browse files
committed
refactor publish workflow for improved deployment process and updated actions
1 parent 92089e2 commit 1e4274d

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
1-
on: [push]
1+
name: Build and Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
28
jobs:
3-
publish:
9+
build-and-deploy:
10+
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
411
runs-on: ubuntu-latest
512
steps:
6-
# build your site for deployment... in this case the `public` folder is being deployed
7-
- name: Checkout
8-
uses: actions/checkout@v3
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
915

1016
- name: Install pnpm
11-
uses: pnpm/action-setup@v2
17+
uses: pnpm/action-setup@v4
1218
with:
1319
version: 9
1420

15-
- name: Build Site
21+
- name: Use Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "20"
25+
cache: "pnpm"
26+
27+
- name: Install and Build # This example project is built using pnpm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
1628
run: |
1729
pnpm install
1830
pnpm run build
1931
20-
- name: Publish
21-
uses: South-Paw/action-netlify-cli@v2
22-
id: netlify
32+
- name: Deploy to GitHub Pages
33+
uses: JamesIves/github-pages-deploy-action@v4
2334
with:
24-
# be sure to escape any double quotes with a backslash
25-
args: 'deploy --json --prod --dir \"./dist\" --message \"production [${{ github.sha }}]\"'
26-
env:
27-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
28-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
29-
30-
# and access outputs in other steps with ${{ steps.netlify.outputs.OUTPUT_ID }}
35+
folder: dist # The folder the action should deploy.

0 commit comments

Comments
 (0)