Skip to content

Commit

Permalink
CI: add commit sha to image label and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
cmj2002 committed Aug 14, 2024
1 parent 9ee31cb commit 18d5fdb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ jobs:
with:
build-args: |
GOST_VERSION=${{ steps.get-gost-version.outputs.GOST_VERSION }}
WARP_VERSION=${{ steps.get-warp-client-version.outputs.WARP_VERSION }}
COMMIT_SHA=${{ github.sha }}
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ vars.REGISTRY }}/${{ vars.IMAGE_NAME }}:latest
${{ vars.REGISTRY }}/${{ vars.IMAGE_NAME }}:${{ steps.get-warp-client-version.outputs.WARP_VERSION }}-${{ steps.get-gost-version.outputs.GOST_VERSION }}
${{ vars.REGISTRY }}/${{ vars.IMAGE_NAME }}:${{ steps.get-warp-client-version.outputs.WARP_VERSION }}-${{ steps.get-gost-version.outputs.GOST_VERSION }}-${{ github.sha }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
data/
data/

# debug github actions
.secrets
.vars
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
FROM ubuntu:22.04

ARG WARP_VERSION
ARG GOST_VERSION
ARG COMMIT_SHA
ARG TARGETPLATFORM

LABEL org.opencontainers.image.authors="cmj2002"
LABEL org.opencontainers.image.url="https://github.com/cmj2002/warp-docker"
LABEL WARP_VERSION=${WARP_VERSION}
LABEL GOST_VERSION=${GOST_VERSION}
LABEL COMMIT_SHA=${COMMIT_SHA}

COPY entrypoint.sh /entrypoint.sh

# install dependencies
Expand Down

0 comments on commit 18d5fdb

Please sign in to comment.