diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7c20beb6..6e2443dc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -168,20 +168,13 @@ jobs: uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository }} - - name: Short commit SHA - id: short - run: | - SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}" - SHORT_SHA=${SHA:0:7} - echo "sha: $SHORT_SHA" - echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT - name: Build and publish Docker image uses: docker/build-push-action@v5 with: context: . push: true build-args: | - WEBRCI_SHA=${{ steps.short.outputs.sha }} + WEBRCI_SHA=${{ github.sha }} MAKE_LIBS_TARGET=all tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 70006338..6a0efe49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,19 +47,29 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Short commit SHA - id: short + - name: Obtain git ref for PR + if: ${{ github.event.pull_request.head.sha != '' }} run: | - SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}" - SHORT_SHA=${SHA:0:7} - echo "sha: $SHORT_SHA" - echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT + REPO="https://github.com/${{github.event.pull_request.head.repo.full_name}}.git" + echo "repo: $REPO" + echo "repo=$REPO" >> $GITHUB_OUTPUT + SHA="${{ github.event.pull_request.head.sha }}" + echo "sha=$SHA" >> $GITHUB_OUTPUT + - name: Obtain git ref + if: ${{ github.event.pull_request.head.sha == '' }} + run: | + REPO="https://github.com/${{ github.repository }}.git" + echo "repo: $REPO" + echo "repo=$REPO" >> $GITHUB_OUTPUT + SHA="${{ github.sha }}" + echo "sha=$SHA" >> $GITHUB_OUTPUT - name: Build Docker image uses: docker/build-push-action@v5 with: context: . push: false build-args: | + WEBRCI_REPO=${{ steps.short.outputs.repo }} WEBRCI_SHA=${{ steps.short.outputs.sha }} MAKE_LIBS_TARGET=default build-nix: diff --git a/Dockerfile b/Dockerfile index 120f158f..90b8932e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -72,7 +72,8 @@ RUN rig add 4.4.0 --without-pak RUN /opt/R/current/bin/R -q -e 'install.packages("pak", lib = .Library)' # Download webR and configure for LLVM flang -RUN git clone https://github.com/r-wasm/webr.git /opt/webr +ARG WEBRCI_REPO="https://github.com/r-wasm/webr.git" +RUN git clone ${WEBRCI_REPO} /opt/webr WORKDIR /opt/webr ARG WEBRCI_SHA=HEAD RUN git checkout ${WEBRCI_SHA}