Skip to content

Commit a48ec3a

Browse files
committed
chore: try to setup new actions pages
1 parent 40e10e1 commit a48ec3a

File tree

3 files changed

+75
-18
lines changed

3 files changed

+75
-18
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to Github Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-20.04
11+
strategy:
12+
matrix:
13+
node-version: [18.19]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Use Node ${{ matrix.node-version }}
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build Docs
27+
run: npm run build:docs
28+
29+
- name: Deploy
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ./apps/docs/out

.github/workflows/deploy.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,55 @@
1-
name: Deploy to Github Pages
1+
name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
716

817
jobs:
9-
deploy:
10-
runs-on: ubuntu-20.04
11-
strategy:
12-
matrix:
13-
node-version: [18.19]
18+
build:
19+
runs-on: ubuntu-latest
1420
steps:
1521
- name: Checkout
16-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
1723

18-
- name: Use Node ${{ matrix.node-version }}
19-
uses: actions/setup-node@v3
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
2026
with:
21-
node-version: ${{ matrix.node-version }}
27+
node-version: '18'
28+
cache: 'npm'
2229

2330
- name: Install dependencies
2431
run: npm ci
2532

26-
- name: Build Docs
33+
- name: Build docs
2734
run: npm run build:docs
35+
env:
36+
NODE_ENV: production
37+
38+
- name: Setup Pages
39+
uses: actions/configure-pages@v4
2840

29-
- name: Deploy
30-
uses: peaceiris/actions-gh-pages@v3
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
3143
with:
32-
github_token: ${{ secrets.GITHUB_TOKEN }}
33-
publish_dir: ./apps/docs/out
44+
path: ./apps/docs/out
45+
46+
deploy:
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
runs-on: ubuntu-latest
51+
needs: build
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

apps/docs/next.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ module.exports = (phase, { defaultConfig }) => {
55
return {
66
reactStrictMode: false,
77
output: "export",
8-
basePath: phase === PHASE_DEVELOPMENT_SERVER ? "" : "/react-use-zendesk",
8+
basePath: process.env.NODE_ENV === "production" ? "/nome-del-tuo-repo" : "",
9+
assetPrefix:
10+
process.env.NODE_ENV === "production" ? "/nome-del-tuo-repo/" : "",
911
};
1012
};

0 commit comments

Comments
 (0)