From 7ae93b174aee950b0420e0b59fca3270cdc77e58 Mon Sep 17 00:00:00 2001 From: Pedro Faria Date: Fri, 6 Oct 2023 14:57:08 -0300 Subject: [PATCH] fix2 --- .github/workflows/build-and-push-docker.yaml | 8 ++++++-- .github/workflows/build-and-release.yaml | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-push-docker.yaml b/.github/workflows/build-and-push-docker.yaml index 2cc08dad..60367d22 100644 --- a/.github/workflows/build-and-push-docker.yaml +++ b/.github/workflows/build-and-push-docker.yaml @@ -11,9 +11,11 @@ jobs: steps: - name: Checkout and setup uses: actions/checkout@v2 + - name: Get the version id: get_version - run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT" + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -25,15 +27,17 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push uses: docker/build-push-action@v5 with: build-args: | - VERSION=$VERSION + VERSION=${{ steps.get_version.outputs.VERSION }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index b6040213..b1fae0e6 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -17,11 +17,11 @@ jobs: go-version: '^1.21.0' - name: Get the version id: get_version - run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT" - name: Build accweb release - run: chmod u+x ./build/build_release.sh && ./build/build_release.sh ${VERSION} + run: chmod u+x ./build/build_release.sh && ./build/build_release.sh ${{ steps.get_version.outputs.VERSION }} - uses: ncipollo/release-action@v1 with: - artifacts: 'releases/accweb_${VERSION}.zip' + artifacts: 'releases/accweb_${{ steps.get_version.outputs.VERSION }}.zip' generateReleaseNotes: true token: ${{ secrets.GITHUB_TOKEN }}