Skip to content

Commit 62b6a99

Browse files
committed
Use actions/deploy-pages@v4 action instead of gh-pages branch
Using this action updates the online HTML pages without needing to commit them to a Git branch. This will avoid the gh-pages branch growing ever larger and larger with all the generated HTML pages.
1 parent 45f5f3e commit 62b6a99

File tree

1 file changed

+22
-30
lines changed

1 file changed

+22
-30
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ concurrency:
1616
group: "pages"
1717
cancel-in-progress: false
1818

19+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
1925
jobs:
20-
update-html-pages:
26+
generate-html-pages:
2127
runs-on: ubuntu-latest
2228

2329
steps:
@@ -38,34 +44,20 @@ jobs:
3844
- name: Generate HTML lists
3945
run: make lists
4046

41-
# Clone the gh-pages branch into a sub-directory.
42-
# The default fetch-depth:1 is OK for this step.
43-
- name: Clone repo again in order to push
44-
uses: actions/checkout@v5
47+
# Make the HTML pages available the the deploy job below.
48+
- name: Upload artifacts
49+
uses: actions/upload-pages-artifact@v3
4550
with:
46-
ref: 'gh-pages'
47-
path: 'gh-pages'
48-
clean: 'false'
51+
patch: mailing/
4952

50-
- name: Update online pages
51-
run: |
52-
: Push new HTML files to gh-pages branch
53-
mv mailing/*.html gh-pages/
54-
rmdir mailing
55-
cd gh-pages
56-
git config user.name "github-actions"
57-
git config user.email "[email protected]"
58-
# Stage any changes to the individual issues (including new files):
59-
git add issue*.html
60-
# This only compares the staged changes, so ignores new timestamps
61-
# in the lwg-*.html files. The commit -a will pick those up though.
62-
printf '\nChecking HTML issues for changes ...\n'
63-
if git diff --cached --exit-code --name-status ; then
64-
echo 'No changes, not publishing new lists.'
65-
else
66-
printf '\nCommitting the changes above:\n'
67-
git commit -a -m 'Automatic update from GitHub Actions workflow'
68-
printf '\nPushing to the gh-pages branch:\n'
69-
git push
70-
fi
71-
cd ..
53+
# Deployment job
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
runs-on: ubuntu-latest
59+
needs: generate-html-pages
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)