mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: Docker Image CI
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
- name: Docker Hub login
|
|
env:
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
run: |
|
|
echo "${DOCKERHUB_TOKEN}" | docker login --username ${DOCKERHUB_USERNAME} --password-stdin
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: crazy-max/ghaction-docker-buildx@v1
|
|
with:
|
|
buildx-version: latest
|
|
|
|
- name: Build Dockerfile
|
|
env:
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
run: |
|
|
docker buildx build \
|
|
--platform=linux/amd64,linux/arm64 \
|
|
--output "type=image,push=true" \
|
|
--file ${{ github.event.inputs.project }}/Dockerfile ./${{ github.event.inputs.project }} \
|
|
--tag $(echo "${DOCKERHUB_USERNAME}" | tr '[:upper:]' '[:lower:]')/x-ui:latest
|