verbose
Some checks failed
Base DNS Docker Image CI/CD Build / build-docker-image (push) Has been cancelled
Some checks failed
Base DNS Docker Image CI/CD Build / build-docker-image (push) Has been cancelled
This commit is contained in:
parent
024794393e
commit
77c3b40983
@ -13,18 +13,22 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Build Docker Image (with run number tag)
|
- name: Build Docker Image (with run number tag)
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
docker build \
|
docker build \
|
||||||
--tag $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }} \
|
--tag $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }} \
|
||||||
--no-cache .
|
--no-cache .
|
||||||
- name: Build Docker Image (with run number tag)
|
- name: Build Docker Image (with run number tag)
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
docker push $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }}
|
docker push $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }}
|
||||||
- name: Tag and Push `latest` Docker image (if main branch)
|
- name: Tag and Push `latest` Docker image (if main branch)
|
||||||
if: ${{ github.ref }} == 'refs/heads/main'
|
if: ${{ github.ref }} == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
docker tag $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }} $CONTAINER_NAME:latest
|
docker tag $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }} $CONTAINER_NAME:latest
|
||||||
docker push $CONTAINER_NAME:latest
|
docker push $CONTAINER_NAME:latest
|
||||||
- name: Clean up Docker Images
|
- name: Clean up Docker Images
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
docker rmi $CONTAINER_NAME:latest || true # Avoid failure if 'latest' tag does not exist
|
docker rmi $CONTAINER_NAME:latest || true # Avoid failure if 'latest' tag does not exist
|
||||||
docker rmi $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }}
|
docker rmi $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }}
|
||||||
|
Loading…
Reference in New Issue
Block a user