From 01e72efb80ef0252a407a97795aa558e1362fece Mon Sep 17 00:00:00 2001 From: Giacomo Date: Fri, 13 Nov 2020 16:00:42 +0100 Subject: [PATCH] Feature/improve dockerhub deployment (#98) * Add docker deployment for Github actions * Add docker specs for the release of tagged and latest versions, also add specs for nightly builds Co-authored-by: Denis Granha --- .github/workflows/deploy-docker-nightly.yml | 29 ++++++++++++++++++++ .github/workflows/deploy-docker-tag.yml | 30 +++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/deploy-docker-nightly.yml create mode 100644 .github/workflows/deploy-docker-tag.yml diff --git a/.github/workflows/deploy-docker-nightly.yml b/.github/workflows/deploy-docker-nightly.yml new file mode 100644 index 000000000..b80691b15 --- /dev/null +++ b/.github/workflows/deploy-docker-nightly.yml @@ -0,0 +1,29 @@ +name: Docker Image Nightly Release + +# Run "nightly" build on each commit to "dev" branch. +on: + push: + branches: + - dev + +jobs: + deploy-docker: + name: Build Release + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@master + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - name: Deploy to docker hub + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: openethereum/openethereum + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: scripts/docker/alpine/Dockerfile + tags: "nightly" diff --git a/.github/workflows/deploy-docker-tag.yml b/.github/workflows/deploy-docker-tag.yml new file mode 100644 index 000000000..84beb5dec --- /dev/null +++ b/.github/workflows/deploy-docker-tag.yml @@ -0,0 +1,30 @@ +name: Docker Image Tag and Latest Release + +on: + push: + tags: + - v* + +jobs: + deploy-docker: + name: Build Release + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@master + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - name: Deploy to docker hub + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: openethereum/openethereum + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: scripts/docker/alpine/Dockerfile + tags: "latest,${{ env.RELEASE_VERSION }}"