支持 Windows 从网络获取时间 #37
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: Publish | |
on: | |
push: | |
branches: [ master ] | |
release: | |
types: [ created ] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup qemu | |
uses: docker/setup-qemu-action@v2 | |
- name: setup docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: login docker hub | |
uses: docker/login-action@v2 | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: login github container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: setup version number | |
if: github.event_name == 'release' | |
run: | | |
GIT_TAG=${{ github.event.release.tag_name }} | |
echo "IMAGE_TAG=${GIT_TAG#v}" >> $GITHUB_ENV | |
- name: build and publish | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
provenance: false | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: | | |
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/candy:${{ env.IMAGE_TAG || 'latest' }} | |
ghcr.io/${{ github.actor }}/candy:${{ env.IMAGE_TAG || 'latest' }} |