Added options to not tag docker with branch name or version. #27
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: CI | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Analyze | |
run: make analyze | |
- name: Unit test | |
run: make unit_test | |
- name: Docker build branch | |
run: make docker | |
if: ${{ github.ref_type == 'branch' }} | |
- name: Docker build main | |
run: make docker ARGS="-t latest" | |
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }} | |
- name: Docker build tag | |
run: make docker ARGS="-t ${{github.ref_name}}" | |
if: ${{ github.ref_type == 'tag' }} |