docker: build with build-arg for runtime version
Some checks failed
/ push (push) Has been cancelled

This commit is contained in:
Tigor Hutasuhut 2024-05-13 11:11:54 +07:00
parent 857c2dff13
commit a150f6ee8b
2 changed files with 2 additions and 2 deletions

View file

@ -18,5 +18,5 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/checkout@v4
- run: echo "Building version ${{ github.ref_name }}"
- run: docker build -t git.tigor.web.id/tigor/redmage:${{ github.ref_name }} -t git.tigor.web.id/tigor/redmage:latest .
- run: docker build --build-arg REDMAGE_RUNTIME_VERSION=${{ github.ref_name }} -t git.tigor.web.id/tigor/redmage:${{ github.ref_name }} -t git.tigor.web.id/tigor/redmage:latest .
- run: docker image push --all-tags git.tigor.web.id/tigor/redmage

View file

@ -15,7 +15,7 @@ COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=web-builder /web/public ./public
ENV REDMAGE_RUNTIME_VERSION=unknown
ARG REDMAGE_RUNTIME_VERSION=unknown
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
make build-docker && \