feat:sql #2
Workflow file for this run
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: Build and Push Docker Image | |
on: | |
push: | |
tags: | |
- 'v*' # 触发以 "v" 开头的标签 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Remove v prefix and set image tag | |
id: set_tag | |
run: | | |
TAG=${GITHUB_REF##*/} # 取得标签名,如 v1.0.1 | |
IMAGE_TAG=${TAG#v} # 移除前缀 v | |
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV | |
- name: Build the Docker image | |
run: | | |
docker build --build-arg IMAGE_TAG=${{ env.IMAGE_TAG }} -t gzydong/lumenim:${{ env.IMAGE_TAG }} -t gzydong/lumenim:latest . | |
- name: Push the Docker image | |
run: | | |
docker push gzydong/lumenim:${{ env.IMAGE_TAG }} | |
docker push gzydong/lumenim:latest |