diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 9bfd043..17c6fb9 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -54,7 +54,9 @@ jobs: REMOTE: http://git.adam-french.co.uk:3000/adamf/usaco.git GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} CACHE: /home/adamf/.cache/usaco-ci/repo.git - SRC: /home/adamf/.cache/usaco-ci/src-${{ github.sha }} + # Per run, not just per commit: the build runner takes two jobs at + # once, and the same commit pushed to two branches runs twice. + SRC: /home/adamf/.cache/usaco-ci/src-${{ github.sha }}-${{ github.run_id }} steps: - name: Export the pushed commit's site/ to a scratch directory shell: bash @@ -117,7 +119,7 @@ jobs: env: SHA: ${{ github.sha }} CACHE: /home/adamf/.cache/usaco-ci/repo.git - SRC: /home/adamf/.cache/usaco-ci/publish-${{ github.sha }} + SRC: /home/adamf/.cache/usaco-ci/publish-${{ github.sha }}-${{ github.run_id }} REGISTRY_USER: ${{ secrets.REGISTRY_USER }} REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} # The Dockerfile's `RUN --mount=type=cache` lines need BuildKit. @@ -148,7 +150,7 @@ jobs: shell: bash run: | set -eu - name="usaco-runner-ci-$SHA" + name="usaco-runner-ci-$SHA-${{ github.run_id }}" docker run -d --name "$name" --read-only --tmpfs /tmp:size=256m,exec \ --memory 1g --pids-limit 128 --cap-drop ALL --security-opt no-new-privileges \ "$RUNNER_IMAGE:$SHA" >/dev/null