From 906420381288b203da002bc2488724c42bba34e1 Mon Sep 17 00:00:00 2001 From: Eldwan Brianne Date: Tue, 19 Jan 2021 12:19:38 +0100 Subject: [PATCH] Added workflow --- .github/workflows/master.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/tag.yml | 39 ++++++++++++++++++++++++++++++++++++ README.md | 3 +++ 3 files changed, 80 insertions(+) create mode 100644 .github/workflows/master.yml create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000000..8d9c3803c9 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,38 @@ +name: Build/Push (master) + +on: + push: + branches: + - 'master' + pull_request: + branches: + - 'master' + +jobs: + build-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/arm64,linux/amd64 + push: true + tags: ebrianne/docker-deluge-openvpn:latest \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000000..d7148a0e5b --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,39 @@ +name: Build/Push (tag) + +on: + push: + tags: + - '*' + +jobs: + build-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Get the version + id: get_version + run: echo ::set-output name=TAG_NAME::${GITHUB_REF/refs\/tags\//} + + - name: Build and push docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/arm64,linux/amd64 + push: true + tags: ebrianne/docker-deluge-openvpn:${{ steps.get_version.outputs.TAG_NAME }} diff --git a/README.md b/README.md index 9286302a6b..055b9fa188 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # OpenVPN and Deluge with WebUI +![Build/Push (master)](https://github.com/ebrianne/docker-deluge-openvpn/workflows/Build/Push%20(master)/badge.svg?branch=master) +[![Docker Pulls](https://img.shields.io/docker/pulls/ebrianne/docker-deluge-openvpn.svg)](https://hub.docker.com/r/ebrianne/docker-deluge-openvpn/) + ## Acknowledgments This project is based heavily on the fork of [docker-transmission-openvpn](https://github.com/haugene/docker-transmission-openvpn).