chore: bump docker image tag #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- docker | |
paths: | |
- .github/workflows/docker.yml | |
- Dockerfile | |
env: | |
IMAGE_NAME: recap | |
CONTEXT: "./" | |
NAMESPACE: nciccbr | |
VERSION_TAG: 0.2.1 | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare build-time variables | |
id: vars | |
run: | | |
echo "DATE=$(date +"%Y-%m-%d")" >> "$GITHUB_OUTPUT" | |
- name: debug | |
run: | | |
echo "the github tag is ${{ github.ref_name }}" | |
echo "github event_name is ${{ github.event_name }}" | |
echo "the version tag is ${{ env.VERSION_TAG }}" | |
- name: Login to DockerHub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.VERSION_TAG }} | |
context: ${{ env.CONTEXT }} | |
file: ${{ env.CONTEXT }}/Dockerfile | |
build-args: | | |
BUILD_DATE=${{ steps.vars.outputs.DATE }} | |
BUILD_TAG=${{ env.VERSION_TAG }} | |
REPONAME=${{ env.IMAGE_NAME }} |