Sync next-koma.json from wiki #216
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: "Build die-koma.org" | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: "Build the die-koma.org website" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v18 | |
- env: | |
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} | |
run: echo "name=BRANCH_NAME::${BRANCH_NAME_OR_REF#refs/heads/}" >> $GITHUB_ENV | |
- run: echo "name=PR_NUMBER::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV | |
- run: nix --print-build-logs build .#KoMaHomepageTar -o homepage.tar.xz | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: homepage.tar.xz | |
check-links: | |
name: "Check for broken links" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v18 | |
- env: | |
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} | |
run: echo "name=BRANCH_NAME::${BRANCH_NAME_OR_REF#refs/heads/}" >> $GITHUB_ENV | |
- run: echo "name=PR_NUMBER::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV | |
- run: nix --print-build-logs run .#check-links | |
release: | |
if: github.repository == 'Die-KoMa/die-koma.org' && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
name: "Release the website to the release branch" | |
concurrency: | |
# Allow one concurrent deployment | |
group: "release" | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: release | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-artifacts | |
- run: rm -rf homepage | |
- run: tar xvf homepage.tar* | |
- run: mv build homepage | |
- run: git add homepage | |
- run: git status | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "KoMa GitHub Runner" | |
- run: git commit -m "Update homepage built from $GITHUB_SHA" || true | |
- run: git push |