Skip to content

Commit

Permalink
Add build info
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-morin committed Jun 12, 2024
1 parent 9339173 commit 49fd40c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CICD-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:${{ github.ref_name }}
build-args: |
GIT_BRANCH=${{ github.ref_name }}
GIT_COMMIT=${{ github.sha }}
IMAGE_TAG=${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:${{ github.ref_name }}
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
refresh-dev-staging-deployment:
name: Refresh Dev Staging Deployment
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/CICD-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:${{ github.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:latest
build-args: |
GIT_BRANCH=${{ github.ref_name }}
GIT_COMMIT=${{ github.sha }}
IMAGE_TAG=${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:latest
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
refresh-main-staging-deployment:
name: Refresh Main Staging Deployment
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ RUN mkdir /home/inaturalist/api/log
RUN mkdir /home/inaturalist/api/cache
RUN mkdir -p /home/inaturalist/api/public/uploads

ARG GIT_BRANCH
ARG GIT_COMMIT
ARG IMAGE_TAG
ARG BUILD_DATE

ENV GIT_BRANCH=${GIT_BRANCH}
ENV GIT_COMMIT=${GIT_COMMIT}
ENV IMAGE_TAG=${IMAGE_TAG}
ENV BUILD_DATE=${BUILD_DATE}

RUN echo "GIT_BRANCH=${GIT_BRANCH}" >> /home/inaturalist/api/build_info
RUN echo "GIT_COMMIT=${GIT_COMMIT}" >> /home/inaturalist/api/build_info
RUN echo "IMAGE_TAG=${IMAGE_TAG}" > /home/inaturalist/api/build_info
RUN echo "BUILD_DATE=${BUILD_DATE}" >> /home/inaturalist/api/build_info

FROM base as test

ENV NODE_ENV=test
Expand Down

0 comments on commit 49fd40c

Please sign in to comment.