From ae3462e91084bc4dc62125bb3851f66947836c19 Mon Sep 17 00:00:00 2001 From: "Victor R. Santos" Date: Mon, 4 Oct 2021 16:49:11 -0300 Subject: [PATCH] Add manual dispatch workflow Workflow for building docker images on multiple platforms (x64, arm64 and arm) Fix .gitignore because of missing files during workflow --- .github/workflows/manual-build-push.yml | 97 +++++++++++++++++++++++++ .gitignore | 7 +- 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/manual-build-push.yml diff --git a/.github/workflows/manual-build-push.yml b/.github/workflows/manual-build-push.yml new file mode 100644 index 0000000..ce9b290 --- /dev/null +++ b/.github/workflows/manual-build-push.yml @@ -0,0 +1,97 @@ +--- +name: Dispatch Build + +on: + workflow_dispatch: + inputs: + branch-tag: + description: 'Branch/Tag to Checkout' + required: false + default: 'master' + platforms: + description: 'Set the platforms to build [ linux/amd64, linux/arm64, linux/arm/v7 or linux/arm/v6]' + required: false + default: 'linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6' + +jobs: + build: + runs-on: ubuntu-latest + + env: + IMAGE: victorrds/3proxy + LABELS: | + maintainer=${{ github.actor }} + org.opencontainers.image.authors='Vladimir \'3APA3A\' Dubrovin <3proxy@3proxy.org>;Victor R. Santos ' + QEMU_PLAT: amd64,arm64,arm + META_TAGS: | + type=sha + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} + + steps: + - name: Checkout Dockerfiles and Context + uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.branch-tag }} + + - id: metadata_full + uses: docker/metadata-action@v3 + with: + labels: ${{ env.LABELS }} + images: | + ${{ env.IMAGE }} + flavor: | + latest=true + tags: | + ${{ env.META_TAGS }} + type=raw,suffix=,value=full + + - id: metadata_minimal + uses: docker/metadata-action@v3 + with: + labels: ${{ env.LABELS }} + images: | + ${{ env.IMAGE }} + flavor: | + suffix=-minimal + tags: | + ${{ env.META_TAGS }} + type=raw,suffix=,value=minimal + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: ${{ env.QEMU_PLAT }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build and Push Minimal + id: build_push_minimal + uses: docker/build-push-action@v2 + with: + builder: ${{ steps.buildx.outputs.name }} + platforms: ${{ github.event.inputs.platforms }} + file: ./Dockerfile.minimal + tags: ${{ steps.metadata_minimal.outputs.tags }} + labels: ${{ steps.metadata_minimal.outputs.labels }} + push: true + + - name: Build and Push Full + id: build_push_full + uses: docker/build-push-action@v2 + with: + builder: ${{ steps.buildx.outputs.name }} + platforms: ${{ github.event.inputs.platforms }} + file: ./Dockerfile.full + tags: ${{ steps.metadata_full.outputs.tags }} + labels: ${{ steps.metadata_full.outputs.labels }} + push: true diff --git a/.gitignore b/.gitignore index b562c58..3c35fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,7 @@ doc/html/man3/ doc/html/man8/ *.var verfile.sh -Makefile +/Makefile copytgz.sh *~.nib local.properties @@ -258,3 +258,8 @@ pip-log.txt #Mr Developer .mr.developer.cfg + +#Act +.actrc +.secrets +.inputs.json \ No newline at end of file