workflow formatting
All checks were successful
Base DNS Docker Image CI/CD Build / build-docker-image (push) Successful in 1m8s
All checks were successful
Base DNS Docker Image CI/CD Build / build-docker-image (push) Successful in 1m8s
This commit is contained in:
parent
f87a0caaa6
commit
6ee069715a
@ -11,20 +11,20 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
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: |
|
||||||
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: Push Docker image with run number tag
|
- name: Build Docker Image (with run number tag)
|
||||||
run: |
|
run: |
|
||||||
docker push $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }}
|
docker push $CONTAINER_NAME:$MAJOR_VERSION.${{ github.run_number }}
|
||||||
- name: Tag and push Docker image as latest if on master 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: |
|
||||||
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: |
|
||||||
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