Repair tagging process
Some checks failed
Build and publish Docker Image / helm-lint (push) Failing after 8s
Some checks failed
Build and publish Docker Image / helm-lint (push) Failing after 8s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build docker image
|
||||
name: Build and publish Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -19,21 +19,21 @@ jobs:
|
||||
|
||||
- name: Log in to Docker registry
|
||||
run: |
|
||||
# Remove https:// from GITHUB_SERVER_URL
|
||||
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||
echo "${{ secrets.DOCKER_REPO_TOKEN }}" | docker login $REGISTRY -u "${{ secrets.DOCKER_REPO_USER }}" --password-stdin
|
||||
echo "${{ secrets.DOCKER_REPO_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.DOCKER_REPO_USER }}" --password-stdin
|
||||
|
||||
- name: Build and tag Docker image
|
||||
run: |
|
||||
COMMIT_HASH=$(echo $GITHUB_SHA | cut -c1-7)
|
||||
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||
IMAGE="$REGISTRY/tomislav/duino-miner-helm/duino-coin"
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
COMMIT_HASH="${GITHUB_SHA::7}" # short SHA
|
||||
SAFE_REPO="${GITHUB_REPOSITORY//\//-}" # replace slashes with dashes
|
||||
IMAGE="$REGISTRY/$SAFE_REPO/duino-coin"
|
||||
echo "Building Docker image with tags: latest and $COMMIT_HASH"
|
||||
docker build -t $IMAGE:latest -t $IMAGE:$COMMIT_HASH .
|
||||
docker build -t "$IMAGE:latest" -t "$IMAGE:$COMMIT_HASH" .
|
||||
|
||||
- name: Push Docker image
|
||||
run: |
|
||||
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||
IMAGE="$REGISTRY/tomislav/duino-miner-helm/duino-coin"
|
||||
docker push $IMAGE:latest
|
||||
docker push $IMAGE:$COMMIT_HASH
|
||||
SAFE_REPO="${GITHUB_REPOSITORY//\//-}"
|
||||
IMAGE="$REGISTRY/$SAFE_REPO/duino-coin"
|
||||
docker push "$IMAGE:latest"
|
||||
docker push "$IMAGE:$COMMIT_HASH"
|
||||
|
Reference in New Issue
Block a user