Skip to content

修改action

修改action #117

Workflow file for this run

name: Docker Image CI
on:
push:
tags:
- 'v*'
# 每次 push tag 时进行构建,不需要每次 push 都构建。使用通配符匹配每次 tag 的提交,记得 tag 名一定要以 v 开头
env:
# 设置 docker 镜像名
IMAGE_NAME: aibotk/wechat-assistant
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Log into registry
run: echo "${{ secrets.ACCESS_TOKEN }}" | docker login -u aibotk --password-stdin
- name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Set up Docker Buildx
run: docker buildx create --name mybuilder --use
- name: Enable Docker Buildx
run: docker buildx use mybuilder
- name: Build and push
run: docker buildx build --platform linux/amd64,linux/arm64/v8,linux/arm/v7 -t ${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }} -t ${{ env.IMAGE_NAME }}:latest . --push