File tree Expand file tree Collapse file tree 2 files changed +15
-37
lines changed Expand file tree Collapse file tree 2 files changed +15
-37
lines changed Original file line number Diff line number Diff line change 1
- name : Deploy to GitHub Pages
1
+ name : Deploy to GitHub Pages on Release
2
2
3
3
on :
4
- push :
5
- branches :
6
- - main
7
4
release :
8
5
types : [published]
9
6
7
+ permissions :
8
+ contents : read
9
+ pages : write
10
+ id-token : write
11
+
10
12
jobs :
11
- build :
13
+ deploy :
12
14
runs-on : ubuntu-latest
15
+
13
16
steps :
14
17
- name : Checkout
15
18
uses : actions/checkout@v4
@@ -26,37 +29,14 @@ jobs:
26
29
- name : Build
27
30
run : npm run build
28
31
32
+ - name : Setup Pages
33
+ uses : actions/configure-pages@v5
34
+
29
35
- name : Upload artifact
30
36
uses : actions/upload-pages-artifact@v3
31
37
with :
32
38
path : ./dist
33
39
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 :
60
40
- name : Deploy to GitHub Pages
61
41
id : deployment
62
- uses : actions/deploy-pages@v4
42
+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -4,10 +4,8 @@ import starlight from '@astrojs/starlight';
4
4
5
5
// https://astro.build/config
6
6
export default defineConfig ( {
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' ) : '/' ,
7
+ site : 'https://flutter-news-app-full-source-code.github.io' ,
8
+ base : '/docs' ,
11
9
integrations : [
12
10
starlight ( {
13
11
title : 'Flutter News App Toolkit' ,
@@ -104,4 +102,4 @@ export default defineConfig({
104
102
] ,
105
103
} ) ,
106
104
] ,
107
- } ) ;
105
+ } ) ;
You can’t perform that action at this time.
0 commit comments