Skip to content

Prevent concurrent deployments from the deploy.yml workflow #1363

Prevent concurrent deployments from the deploy.yml workflow

Prevent concurrent deployments from the deploy.yml workflow #1363

Workflow file for this run

# A workflow to update the online issues lists.
name: Generate HTML pages
on:
# This job must only be run when changes are pushed to the master branch!
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
update-html-pages:
runs-on: ubuntu-latest
steps:
- name: Clone XML sources
uses: actions/checkout@v5
with:
ref: ${{ env.BRANCH }}
# Using fetch-depth implies --single-branch so we don't fetch
# the gh-pages branch (which avoids fetching 99% of the objects).
fetch-depth: 2147483647
- name: Update issue timestamps
run: make dates
- name: Build programs
run: make CXX=g++-14 pgms -j $(getconf _NPROCESSORS_ONLN)
- name: Generate HTML lists
run: make lists
# Clone the gh-pages branch into a sub-directory.
# The default fetch-depth:1 is OK for this step.
- name: Clone repo again in order to push
uses: actions/checkout@v5
with:
ref: 'gh-pages'
path: 'gh-pages'
clean: 'false'
- name: Update online pages
run: |
: Push new HTML files to gh-pages branch
mv mailing/*.html gh-pages/
rmdir mailing
cd gh-pages
git config user.name "github-actions"
git config user.email "[email protected]"
# Stage any changes to the individual issues (including new files):
git add issue*.html
# This only compares the staged changes, so ignores new timestamps
# in the lwg-*.html files. The commit -a will pick those up though.
printf '\nChecking HTML issues for changes ...\n'
if git diff --cached --exit-code --name-status ; then
echo 'No changes, not publishing new lists.'
else
printf '\nCommitting the changes above:\n'
git commit -a -m 'Automatic update from GitHub Actions workflow'
printf '\nPushing to the gh-pages branch:\n'
git push
fi
cd ..