File tree Expand file tree Collapse file tree 2 files changed +35
-13
lines changed Expand file tree Collapse file tree 2 files changed +35
-13
lines changed Original file line number Diff line number Diff line change 1
- name : Deploy to GitHub Pages on Release
1
+ name : Deploy to GitHub Pages
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - main
4
7
release :
5
8
types : [published]
6
9
7
- permissions :
8
- contents : read
9
- pages : write
10
- id-token : write
11
-
12
10
jobs :
13
- deploy :
11
+ build :
14
12
runs-on : ubuntu-latest
15
-
16
13
steps :
17
14
- name : Checkout
18
15
uses : actions/checkout@v4
@@ -29,14 +26,37 @@ jobs:
29
26
- name : Build
30
27
run : npm run build
31
28
32
- - name : Setup Pages
33
- uses : actions/configure-pages@v5
34
-
35
29
- name : Upload artifact
36
30
uses : actions/upload-pages-artifact@v3
37
31
with :
38
32
path : ./dist
39
33
34
+ deploy-staging :
35
+ needs : build
36
+ if : github.event_name == 'push'
37
+ runs-on : ubuntu-latest
38
+ permissions :
39
+ pages : write
40
+ id-token : write
41
+ environment :
42
+ name : github-pages
43
+ url : ${{ steps.deployment.outputs.page_url }}
44
+ steps :
45
+ - name : Deploy to GitHub Pages
46
+ id : deployment
47
+ uses : actions/deploy-pages@v4
48
+
49
+ deploy-production :
50
+ needs : build
51
+ if : github.event_name == 'release'
52
+ runs-on : ubuntu-latest
53
+ permissions :
54
+ pages : write
55
+ id-token : write
56
+ environment :
57
+ name : github-pages
58
+ url : ${{ steps.deployment.outputs.page_url }}
59
+ steps :
40
60
- name : Deploy to GitHub Pages
41
61
id : deployment
42
62
uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import starlight from '@astrojs/starlight';
4
4
5
5
// https://astro.build/config
6
6
export default defineConfig ( {
7
- site : 'https://flutter-news-app-full-source-code.github.io' ,
8
- base : '/docs' ,
7
+ site : process . env . CI
8
+ ? 'https://flutter-news-app-full-source-code.github.io'
9
+ : 'http://localhost:4321' ,
10
+ base : process . env . CI ? ( process . env . GITHUB_EVENT_NAME === 'release' ? '/docs' : '/docs-staging' ) : '/' ,
9
11
integrations : [
10
12
starlight ( {
11
13
title : 'Flutter News App Toolkit' ,
You can’t perform that action at this time.
0 commit comments