Build Docker Image #379
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 Docker Image | |
on: | |
push: | |
branches: | |
- main | |
- master | |
watch: | |
types: [started] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# UTC 18:00 -> CST (China) 2:00, see https://datetime360.com/cn/utc-cst-china-time/ | |
- cron: '0 18 * * *' | |
# 每周运行 | |
#- cron: '0 0 * * 0' | |
workflow_dispatch: | |
jobs: | |
buildx: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Docker Image 构建环境 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# ReleaseTag | |
- name: Set Version | |
id: set-version | |
run: | | |
echo "version=`date +'%y-%m-%d'`" >> $GITHUB_ENV | |
# Build and push | |
- name: Build dockerfile | |
uses: docker/build-push-action@v4 | |
with: | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
push: true | |
tags: | | |
bloodstar/nginx-purge:stable-${{ env.version }} | |
bloodstar/nginx-purge:latest | |