Skip to content

Commit 98c801b

Browse files
committed
Set build info
1 parent f511052 commit 98c801b

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,23 @@ jobs:
4747
username: ${{ github.actor }}
4848
password: ${{ secrets.GITHUB_TOKEN }}
4949

50+
- name: Get build start time
51+
run: |
52+
echo BUILD_TIMESTAMP="$(date --utc --iso-8601=seconds)" >> $GITHUB_ENV
53+
5054
- name: Build and push Docker image
5155
uses: docker/build-push-action@v3
5256
with:
5357
context: .
5458
push: true
5559
tags: ${{ env.BUILD_IMAGE }}
60+
build-args: |
61+
BUILD_TIMESTAMP=${{ env.BUILD_TIMESTAMP }}
62+
BUILD_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
63+
DOCKER_TAG=${{ env.BUILD_IMAGE }}
64+
GIT_BRANCH=${{ github.ref_name }}
65+
GIT_COMMIT=${{ github.sha }}
66+
GIT_URL=${{ github.repositoryUrl }}
5667
5768
outputs:
5869
build_image: ${{ env.BUILD_IMAGE }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ RUN bundle install --local
127127
# ------------------------------------------------------------
128128
# Preserve build arguments
129129

130-
# passed in by Jenkins
130+
# passed in by CI
131131
ARG BUILD_TIMESTAMP
132132
ARG BUILD_URL
133133
ARG DOCKER_TAG

0 commit comments

Comments
 (0)