diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b56733..5f352a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: env: COMPOSE_FILE: docker-compose.yml:docker-compose.ci.yml + DOCKER_APP_IMAGE: app-run-${{ github.run_id}} outputs: imageid: ${{ steps.image }} @@ -64,6 +65,7 @@ jobs: edu.berkeley.lib.git-repository-url=${{ github.repositoryUrl }} edu.berkeley.lib.git-sha=${{ github.sha }} tags: | + type=raw,value=${{ env.DOCKER_APP_IMAGE }} type=sha type=ref,event=branch type=ref,event=pr @@ -87,10 +89,6 @@ jobs: labels: ${{ steps.meta.outputs.labels }} tags: ${{ steps.meta.outputs.tags }} - - name: Set the application image - run: | - echo DOCKER_APP_IMAGE=${{ steps.image.outputs.imageid }} >> "$GITHUB_ENV" - - name: Start the stack run: | docker compose up --build --detach diff --git a/Dockerfile b/Dockerfile index e9da79e..4073fcd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,14 +21,14 @@ RUN mkdir -p /opt/app \ && chown -R $APP_USER:$APP_USER /opt/app /usr/local/bundle # Get list of available packages -RUN apt-get update -qq +RUN apt-get update -qq # Install standard packages from the Debian repository RUN apt-get install -y --no-install-recommends \ bash \ curl \ default-jre \ - ca-certificates \ + ca-certificates \ nodejs \ libpq-dev \ libvips42 \ @@ -42,7 +42,7 @@ USER geodata WORKDIR /opt/app # Add binstubs to the path. -ENV PATH "/opt/app/bin:$PATH" +ENV PATH="/opt/app/bin:$PATH" # If run with no other arguments, the image will start the rails server by @@ -106,14 +106,14 @@ RUN rails assets:precompile assets:clean log:clear tmp:clear ARG BUILD_TIMESTAMP ARG BUILD_URL ARG DOCKER_TAG -ARG GIT_BRANCH -ARG GIT_COMMIT -ARG GIT_URL +ARG GIT_REF_NAME +ARG GIT_SHA +ARG GIT_REPOSITORY_URL # build arguments aren't persisted in the image, but ENV values are ENV BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" ENV BUILD_URL="${BUILD_URL}" ENV DOCKER_TAG="${DOCKER_TAG}" -ENV GIT_BRANCH="${GIT_BRANCH}" -ENV GIT_COMMIT="${GIT_COMMIT}" -ENV GIT_URL="${GIT_URL}" +ENV GIT_REF_NAME="${GIT_REF_NAME}" +ENV GIT_SHA="${GIT_SHA}" +ENV GIT_REPOSITORY_URL="${GIT_REPOSITORY_URL}"