Update status of ex-team member #1961
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ROOT Web Publisher | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
# only deploy if push to main or if pull request not coming from a fork (cannot access github secrets otherwise) | |
SHOULD_DEPLOY: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
jobs: | |
build: | |
name: Jekyll Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Build website | |
uses: root-project/jekyll-action@HEAD | |
- name: Only allow links to root.cern, never root.cern.ch | |
run: | | |
grep -n -R 'root\.cern\.ch' build || exit 0 # grep returns non-zero if no match is found | |
N_WRONG_LINKS=$(grep -R 'root\.cern\.ch' build | wc -l) | |
echo -e "\nFound $N_WRONG_LINKS links to root.cern.ch. Please change them to link to root.cern (no '.ch') instead." | |
exit 1 | |
- name: Only allow links to ref guide for master (except in release notes and when linking to release notes) | |
run: | | |
# grep for https://root.cern/doc/(!"master" && !"vXXX/release-notes.html"). If something is found, error out. | |
grep --exclude="index.html" --exclude-dir="releases" --exclude-dir="reference" --exclude-dir="all_releases" --exclude-dir="feed" -n -R -P 'https:\/\/root\.cern\/doc\/(?!(master|v[0-9]{3}\/release-notes\.html))' build\ | |
|| exit 0 # grep returns non-zero if no match is found | |
echo -e "\nFound links to /doc/NOT_MASTER (see above). Please change them to link to /doc/master." | |
exit 1 | |
- name: Wait for other deployments | |
# wait for other workflows that are deploying the website to finish, (not 100% foolproof, see #240) | |
if: ${{ env.SHOULD_DEPLOY == 'true' && github.event_name != 'pull_request' }} | |
uses: softprops/turnstyle@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Sync to S3 | |
if: ${{ env.SHOULD_DEPLOY == 'true' }} | |
run: | | |
DEST="s3://root/${PR_NUMBER:-}" # if PR, upload in s3://root/<prnumber> | |
aws --endpoint-url https://s3.cern.ch s3 sync --delete build/${PR_NUMBER:-} ${DEST} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: "eu-west-1" |