Skip to content

modify build script

modify build script #3

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: AutoImageWorkflow
on:
push:
tags:
- "v*" # 这里可以使用通配符,例如 'v*' 表示所有以 'v' 开头的标签
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get tag version
id: get_tag_version
run: echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
uses: docker/[email protected]
with:
# Username used to log against the Docker registry
username: ${{ secrets.DOCKER_HUB_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and push image
run: ./script/image.sh ${{ env.TAG_VERSION }}