Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 3d58112

Browse files
committed
andere action voor clone
1 parent ac4ca66 commit 3d58112

File tree

1 file changed

+34
-64
lines changed

1 file changed

+34
-64
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
contents: write
1414
pull-requests: write
15-
# if: github.event_name == 'release'
15+
1616
steps:
1717
- uses: actions/checkout@v4
1818

@@ -30,75 +30,45 @@ jobs:
3030
mkdir content
3131
shopt -s extglob
3232
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 }}
5633
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
7341

74-
- name: Install GitHub CLI
75-
uses: cli/cli-action@v2
42+
- name: Install GitHub CLI
43+
uses: cli/cli-action@v2
7644

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
8050
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"
8353
84-
git checkout -b $BRANCH
54+
git checkout -b $BRANCH
8555
86-
cp -r ../index.html ../content .
56+
cp -r ../index.html ../content .
8757
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]"
9060
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
9565
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

Comments
 (0)