Skip to content

Docker Build and Publish (3:00, UTC+8) #955

Docker Build and Publish (3:00, UTC+8)

Docker Build and Publish (3:00, UTC+8) #955

name: "Docker Build and Publish (3:00, UTC+8)"
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
env:
IMAGE_NAME: dorowolf/akari-bot
TAG: ${{ github.sha }}
run: |
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$TAG -t $IMAGE_NAME:latest --push .