2021-08-06 02:03:25 +08:00
|
|
|
name: Publish Docker image
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
|
|
push_to_docker_hub:
|
|
|
|
name: Push Docker image to Docker Hub
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-09-30 01:10:08 +08:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
2021-08-06 02:03:25 +08:00
|
|
|
- name: Log in to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Push to Docker Hub
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
push: true
|
2021-09-30 01:10:08 +08:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
tags: ${{ secrets.DOCKER_USERNAME }}/slashbot:latest
|