重写的前端 #5
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: 推送开发用的 docker 镜像 | |
on: | |
push: | |
branches: | |
- 'develop' | |
jobs: | |
push_to_registry: | |
name: 推送到 Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout | |
- name: 拉取代码 | |
uses: actions/checkout@v4 | |
with: | |
ref: develop | |
# https://github.com/docker/login-action | |
- name: 登录到 Docker hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# https://github.com/docker/metadata-action | |
- name: 提取事件元数据 | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: mokeyjay/pixiv-daily-ranking-widget | |
# https://github.com/docker/setup-buildx-action | |
- name: 使用 buildx 作为构建器 | |
uses: docker/setup-buildx-action@v3 | |
# https://github.com/docker/build-push-action | |
- name: 构建并推送 | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: docker/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: mokeyjay/pixiv-daily-ranking-widget:latest |