Skip to content

Bump actions/upload-artifact from 3 to 4 #324

Bump actions/upload-artifact from 3 to 4

Bump actions/upload-artifact from 3 to 4 #324

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: LaTeX linter (chktex)
uses: j2kun/[email protected]
# Provide this output for context, but don't fail builds
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-rulebook:
runs-on: ubuntu-latest
container: leplusorg/latex:latest
steps:
- uses: actions/checkout@v4
- name: LaTeX compilation
run:
TERM=xterm make dorulebookonly
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: rulebook
path: rulebook.pdf
build-scoresheets:
runs-on: ubuntu-latest
container: leplusorg/latex:latest
steps:
- uses: actions/checkout@v4
- name: LaTeX compilation
run:
TERM=xterm make doscoresheetsonly
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: score_sheets
path: score_sheets.pdf
deploy-pdfs:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build-rulebook, build-scoresheets]
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Download rulebook
uses: actions/download-artifact@v3
with:
name: rulebook
path: ${{ runner.temp }}/rulebook
- name: Download score sheets
uses: actions/download-artifact@v3
with:
name: score_sheets
path: ${{ runner.temp }}/score_sheets
- name: Preparations for GitHub Pages
if: github.ref == 'refs/heads/master'
env:
ARTIFACTS_PATH: ${{ runner.temp }}
run: |
# Make sure directories exist
cd "$GITHUB_WORKSPACE"
mkdir -p rulebook
mkdir -p score_sheets
FILENAME=${GITHUB_REF/refs\/heads\//}
# Strip out any extra slashes in the rest
FILENAME=${FILENAME//\//\_}.pdf
mv $ARTIFACTS_PATH/rulebook/rulebook.pdf rulebook/$FILENAME
mv $ARTIFACTS_PATH/score_sheets/score_sheets.pdf score_sheets/$FILENAME
- name: Commit and push to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: gh-pages
commit_author: "Continuous Deployment <[email protected]>"
commit_message: "[github actions] deploy"
commit_user_name: "Continuous Deployment"
commit_user_email: "[email protected]"
file_pattern: "rulebook/* score_sheets/*"
repository: ${{ github.workspace }}
skip_checkout: true
skip_fetch: true