@@ -4,10 +4,10 @@ name: Deploy static content to Pages
4
4
on :
5
5
# Runs on pushes targeting the default branch
6
6
push :
7
- branches : ["master"]
7
+ branches : " current_branch "
8
8
pull_request :
9
9
branches :
10
- - ' * '
10
+ - " * "
11
11
12
12
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
13
@@ -19,8 +19,44 @@ concurrency:
19
19
cancel-in-progress : false
20
20
21
21
jobs :
22
+ replace_string :
23
+ runs-on : ubuntu-latest
24
+ steps :
25
+ - name : Set environment variable for branch name
26
+ env :
27
+ BRANCH_NAME : ${{ github.ref }}
28
+ run : echo "Branch name is $BRANCH_NAME"
29
+ - name : Set environment variable for complete repo name
30
+ env :
31
+ REPO_NAME : ${{ github.repository }}
32
+ run : echo "Repository name is $REPO_NAME"
33
+ - name : Set repo name
34
+ run : |
35
+ project_name="quantstack.github.io"
36
+ echo "The value of my_string is: $project_name"
37
+ - name : Set environment variable for owner name
38
+ env :
39
+ REPO_OWNER : ${{ github.repository_owner }}
40
+ run : echo "Repository name is $REPO_OWNER"
41
+ - name : Set environment variable for actor
42
+ env :
43
+ ACTOR_NAME : ${{ github.actor }}
44
+ run : echo "Actor is $ACTOR_NAME"
45
+ - name : Replace baseUrl in config file
46
+ run : |
47
+ prev_base_url=`baseUrl: "/"`
48
+ new_base_url=`baseUrl: "/quantstack.github.io/"`
49
+ organization= `organizationName: "/QuantStack/"`
50
+ fork_name= `organizationName:` + "$ACTOR_NAME"
51
+ echo "organization is $organization"
52
+ echo "fork_name is $fork_name"
53
+ sed -i 's/prev_base_url/new_base_url/g' docusaurus.config.ts
54
+ sed -i 's/prev_organization/new_base_url/g' docusaurus.config.ts
55
+ cat > test.ts
56
+
22
57
build :
23
58
runs-on : ubuntu-latest
59
+ needs : replace_string
24
60
steps :
25
61
- name : Checkout
26
62
uses : actions/checkout@v4
39
75
40
76
deploy :
41
77
needs : build
42
- if : github.ref == 'refs/heads/master'
78
+ # if: github.ref == 'refs/heads/master'
43
79
environment :
44
80
name : github-pages
45
81
url : ${{ steps.deployment.outputs.page_url }}
51
87
steps :
52
88
- name : Deploy to GitHub Pages
53
89
id : deployment
54
- uses : actions/deploy-pages@v4
90
+ uses : actions/deploy-pages@v4
0 commit comments