Update docker.yml

This commit is contained in:
mhsanaei 2024-10-24 21:22:40 +02:00
parent 14435db0d8
commit c800e29900
No known key found for this signature in database
GPG Key ID: 4DACC0663B5986F5

View File

@ -1,5 +1,4 @@
name: Release 3X-UI for Docker name: Release 3X-UI for Docker
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
@ -7,36 +6,50 @@ on:
- "v*.*.*" - "v*.*.*"
jobs: jobs:
build_and_push: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out the code - uses: actions/checkout@v4
uses: actions/checkout@v4 with:
- name: Set up QEMU submodules: true
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Docker meta
uses: docker/setup-buildx-action@v3 id: meta
uses: docker/metadata-action@v5
with:
images: |
hsanaeii/3x-ui
ghcr.io/mhsanaei/3x-ui
tags: |
type=ref,event=branch
type=ref,event=tag
type=pep440,pattern={{version}}
- name: Login to GHCR - name: Set up QEMU
uses: docker/login-action@v3 uses: docker/setup-qemu-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta - name: Set up Docker Buildx
id: meta uses: docker/setup-buildx-action@v3
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Build and push Docker image - name: Login to Docker Hub
uses: docker/build-push-action@v6 uses: docker/login-action@v3
with: with:
context: . username: ${{ secrets.DOCKER_HUB_USERNAME }}
push: ${{ github.event_name != 'pull_request' }} password: ${{ secrets.DOCKER_HUB_TOKEN }}
platforms: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/arm/v6, linux/386
tags: ${{ steps.meta.outputs.tags }} - name: Login to GHCR
labels: ${{ steps.meta.outputs.labels }} uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/arm/v6, linux/386
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}