Skip to content

Build wechotd image #167

Build wechotd image

Build wechotd image #167

Workflow file for this run

name: Build wechotd image
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- branch: main
tag: latest
- branch: alpine
tag: alpine
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
- uses: docker/setup-buildx-action@v3.6.1
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v3
with:
registry: ${{ secrets.ALIYUN_REGISTRY }}
username: ${{ secrets.ALIYUN_REGISTRY_USER }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- uses: docker/build-push-action@v6.5.0
with:
context: ./
file: Dockerfile
github-token: ${{ secrets.GITHUB_TOKEN }}
push: true
provenance: false
platforms: linux/amd64, linux/arm64
tags: |
ghcr.io/${{ github.repository }}/wechotd:${{ matrix.tag }}
${{ secrets.ALIYUN_REGISTRY_REPOSITORY }}:${{ matrix.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max