12
12
permissions :
13
13
contents : write
14
14
pull-requests : write
15
- # if: github.event_name == 'release'
15
+
16
16
steps :
17
17
- uses : actions/checkout@v4
18
18
@@ -30,75 +30,45 @@ jobs:
30
30
mkdir content
31
31
shopt -s extglob
32
32
mv !(content) content
33
- name : Publish
34
- on :
35
- workflow_call :
36
- workflow_dispatch :
37
-
38
- jobs :
39
- release :
40
- name : Release
41
- runs-on : ubuntu-22.04
42
- environment :
43
- name : production
44
- permissions :
45
- contents : write
46
- pull-requests : write
47
-
48
- steps :
49
- - uses : actions/checkout@v4
50
-
51
- - name : Recover HTML
52
- uses : actions/cache@v4
53
- with :
54
- path : ~/static
55
- key : ${{ github.run_id }}
56
33
57
- - name : Gather files
58
- run : |
59
- rm -f *.md *.html
60
- mv ~/static/* ./
61
- mv snapshot.html index.html
62
- mkdir content
63
- shopt -s extglob
64
- mv !(content) content
65
-
66
- - name : Clone docs repo
67
- uses : GuillaumeFalourd/clone-github-repo-action@v2
68
- with :
69
- owner : Geonovum
70
- repository : docs.geostandaarden.nl
71
- access_token : ${{ secrets.GH_PUSH_TOKEN }}
72
- clone_dir : docs-repo
34
+ - name : Clone docs repo
35
+ uses : GuillaumeFalourd/clone-github-repo-action@v2
36
+ with :
37
+ owner : Geonovum
38
+ repository : docs.geostandaarden.nl
39
+ access_token : ${{ secrets.GH_PUSH_TOKEN }}
40
+ clone_dir : docs-repo
73
41
74
- - name : Install GitHub CLI
75
- uses : cli/cli-action@v2
42
+ - name : Install GitHub CLI
43
+ uses : cli/cli-action@v2
76
44
77
- - name : Create branch and PR
78
- run : |
79
- cd docs-repo
45
+ - name : Create branch and PR
46
+ env :
47
+ GH_TOKEN : ${{ secrets.GH_PUSH_TOKEN }}
48
+ run : |
49
+ cd docs-repo
80
50
81
- BRANCH="auto-update-$(date +'%Y%m%d%H%M%S')"
82
- COMMIT_MSG="Automated update from $GITHUB_REPOSITORY"
51
+ BRANCH="auto-update-$(date +'%Y%m%d%H%M%S')"
52
+ COMMIT_MSG="Automated update from $GITHUB_REPOSITORY"
83
53
84
- git checkout -b $BRANCH
54
+ git checkout -b $BRANCH
85
55
86
- cp -r ../index.html ../content .
56
+ cp -r ../index.html ../content .
87
57
88
- git config user.name "Geonovum CI"
89
- git config user.email "[email protected] "
58
+ git config user.name "Geonovum CI"
59
+ git config user.email "[email protected] "
90
60
91
- if [ -n "$(git status --porcelain)" ]; then
92
- git add .
93
- git commit -m "$COMMIT_MSG"
94
- git push origin $BRANCH
61
+ if [ -n "$(git status --porcelain)" ]; then
62
+ git add .
63
+ git commit -m "$COMMIT_MSG"
64
+ git push origin $BRANCH
95
65
96
- gh pr create \
97
- --repo Geonovum/docs.geostandaarden.nl \
98
- --base main \
99
- --head $BRANCH \
100
- --title "$COMMIT_MSG" \
101
- --body "Automatisch gegenereerde publicatie-update vanuit [$GITHUB_REPOSITORY](https://github.com/$GITHUB_REPOSITORY)"
102
- else
103
- echo "❕ Geen wijzigingen om te committen. PR wordt niet aangemaakt."
104
- fi
66
+ gh pr create \
67
+ --repo Geonovum/docs.geostandaarden.nl \
68
+ --base main \
69
+ --head $BRANCH \
70
+ --title "$COMMIT_MSG" \
71
+ --body "Automatisch gegenereerde publicatie-update vanuit [$GITHUB_REPOSITORY](https://github.com/$GITHUB_REPOSITORY)"
72
+ else
73
+ echo "❕ Geen wijzigingen om te committen. PR wordt niet aangemaakt."
74
+ fi
0 commit comments