fix: utility url head file #93
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 Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
IMAGE: ${{ secrets.DOCKER_HUB_USER }}/avant | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: create tag | |
run: | | |
SHA=${{ github.sha }} | |
TAG=${IMAGE}:$(TZ=UTC-9 date '+%Y%m')-${SHA:0:7} | |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then | |
TAG="${IMAGE}:latest" | |
fi | |
echo "TAG=$TAG" >> $GITHUB_ENV | |
echo TAG $TAG | |
- name: login to dockerhub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: build docker image | |
run: | | |
docker build . -t ${{ env.TAG }} | |
- name: push image | |
run: | | |
docker push ${{ env.TAG }} |