From 9f291d5876a33379c220040ab508316e05502424 Mon Sep 17 00:00:00 2001 From: Sadegh Date: Tue, 4 Jan 2022 10:15:29 +0330 Subject: [PATCH] fix(cd): Fix ci for arm --- .github/workflows/publish.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 74cd9f1..0032a2c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -49,21 +49,34 @@ jobs: publish-docker-hub-for-arm: runs-on: ubuntu-latest steps: + - name: Retrieve tag + id: retrieve + run: | + DOCKER_IMAGE=sadeghhayeri/green-tunnel + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + fi + TAGS="${DOCKER_IMAGE}:${VERSION}" + echo ::set-output name=tags::${TAGS} - uses: actions/checkout@master + - 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: Change Base Image run: sed -i 's/mhart\/alpine-node:12/balenalib\/raspberry-pi-alpine-node/g' Dockerfile - - name: Customizable Docker Buildx Build - uses: zmingxie/docker_buildx@v1.1 + - name: Build and push Docker images + uses: docker/build-push-action@v2 with: - tag: arm,arm-latest,arm-1.7.5 - imageName: sadeghhayeri/green-tunnel - dockerFile: Dockerfile - publish: true + file: Dockerfile + push: true + tags: arm-${{ steps.retrieve.outputs.tags }},sadeghhayeri/green-tunnel:arm-latest platform: linux/arm64,linux/arm/v7 - dockerHubUser: ${{ secrets.DOCKER_USERNAME }} - dockerHubPassword: ${{ secrets.DOCKER_PASSWORD }} build-for-mac: runs-on: macOS-latest