Skip to content

Commit 1f7bb73

Browse files
authored
Merge pull request #2 from userclouds/pages
Fix build GHA
2 parents 5e95661 + 467c66b commit 1f7bb73

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1-
# Sample workflow for building and deploying a Next.js site to GitHub Pages
2-
#
3-
# To get started with Next.js see: https://nextjs.org/docs/getting-started
4-
#
51
name: Deploy Docs site to Pages
62

73
on:
8-
# Runs on pushes targeting the default branch
94
push:
105
branches: ["main"]
11-
12-
# Allows you to run this workflow manually from the Actions tab
13-
workflow_dispatch:
14-
15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
6+
pull_request: {}
7+
workflow_dispatch: {}
168
permissions:
179
contents: read
1810
pages: write
1911
id-token: write
20-
21-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2312
concurrency:
2413
group: "pages"
25-
cancel-in-progress: false
26-
14+
cancel-in-progress: true
2715
jobs:
28-
# Build job
2916
build:
3017
runs-on: ubuntu-latest
3118
steps:
@@ -48,7 +35,7 @@ jobs:
4835
with:
4936
node-version: "20"
5037
- name: Install pnpm
51-
uses: pnpm/action-setup@v2
38+
uses: pnpm/action-setup@v4
5239
with:
5340
version: 8
5441
run_install: false
@@ -66,20 +53,16 @@ jobs:
6653
restore-keys: |
6754
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
6855
- name: Install dependencies
69-
run: |
70-
cd docs
71-
pnpm install
56+
run: pnpm install
7257
- name: Build with Next.js
73-
run: |
74-
cd docs
75-
pnpm run build
58+
run: pnpm run build
7659
- name: Upload artifact
7760
uses: actions/upload-pages-artifact@v3
7861
with:
79-
path: ./docs/out
80-
81-
# Deployment job
62+
path: ./out
63+
retention-days: 2
8264
deploy:
65+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
8366
environment:
8467
name: github-pages
8568
url: ${{ steps.deployment.outputs.page_url }}
@@ -89,3 +72,5 @@ jobs:
8972
- name: Deploy to GitHub Pages
9073
id: deployment
9174
uses: actions/deploy-pages@v4
75+
with:
76+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)