From 6a9a571d87aee4a23608137b3cfeeaed8f35c26b Mon Sep 17 00:00:00 2001 From: Matteo Pietro Dazzi Date: Thu, 28 May 2020 09:22:17 +0200 Subject: [PATCH] build: Build Docker images with GitHub actions --- .../workflows/build_publish_docker_image.yml | 23 ++++++++++++++ .../build_publish_release_docker_image.yml | 30 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/build_publish_docker_image.yml create mode 100644 .github/workflows/build_publish_release_docker_image.yml diff --git a/.github/workflows/build_publish_docker_image.yml b/.github/workflows/build_publish_docker_image.yml new file mode 100644 index 000000000..db8ebe979 --- /dev/null +++ b/.github/workflows/build_publish_docker_image.yml @@ -0,0 +1,23 @@ +name: Build and publish develop image + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + name: Build image job + steps: + - name: Checkout master + uses: actions/checkout@master + - name: Build and publish image + uses: ilteoood/docker_buildx@master + with: + tag: beta + imageName: rclone/rclone + platform: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7 + publish: true + dockerHubUser: ${{ secrets.DOCKER_HUB_USER }} + dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }} diff --git a/.github/workflows/build_publish_release_docker_image.yml b/.github/workflows/build_publish_release_docker_image.yml new file mode 100644 index 000000000..189d22ff1 --- /dev/null +++ b/.github/workflows/build_publish_release_docker_image.yml @@ -0,0 +1,30 @@ +name: Build and publish release image +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + name: Build image job + steps: + - name: Checkout master + uses: actions/checkout@master + - name: Get actual patch version + id: actual_patch_version + run: echo ::set-output name=ACTUAL_PATCH_VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/v//g') + - name: Get actual minor version + id: actual_minor_version + run: echo ::set-output name=ACTUAL_MINOR_VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/v//g' | cut -d "." -f 1,2) + - name: Get actual major version + id: actual_major_version + run: echo ::set-output name=ACTUAL_MAJOR_VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/v//g' | cut -d "." -f 1) + - name: Build and publish image + uses: ilteoood/docker_buildx@master + with: + tag: latest,${{ steps.actual_patch_version.outputs.ACTUAL_PATCH_VERSION }},${{ steps.actual_minor_version.outputs.ACTUAL_MINOR_VERSION }},${{ steps.actual_major_version.outputs.ACTUAL_MAJOR_VERSION }} + imageName: rclone/rclone + platform: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7 + publish: true + dockerHubUser: ${{ secrets.DOCKER_HUB_USER }} + dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}