Skip to content

build dev

build dev #69

name: Publish Docker
on:
release:
types: [published]
branches:
- 'master'
workflow_dispatch:
env:
REPO: hlf01/telegram-onedrive
permissions:
contents: read
run-name: ${{ github.event_name == 'workflow_dispatch' && 'build dev' || github.event.release.name }}
jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'hlf20010508'
steps:
- name: Checkout
uses: actions/checkout@v3
- 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.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
file: Dockerfile
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.REPO }}:${{ github.event.release.name }},${{ env.REPO }}:latest,${{ env.REPO }}:dev
if: github.event_name == 'release' && github.event.action == 'published'
- name: Build and push image dev
uses: docker/build-push-action@v5
with:
file: Dockerfile
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.REPO }}:dev
if: github.event_name == 'workflow_dispatch'