diff --git a/.github/workflows/publish-rolling.yml b/.github/workflows/publish-rolling.yml index 8f5a2f3d..b30b52c8 100644 --- a/.github/workflows/publish-rolling.yml +++ b/.github/workflows/publish-rolling.yml @@ -40,6 +40,7 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} docker: + needs: npm runs-on: ubuntu-20.04 steps: @@ -59,17 +60,25 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Tag rolling release + - name: Parse version + id: parse_version run: | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - npm version --no-git-tag-version 0.0.0-master.`git rev-parse --short HEAD` + echo ::set-output name=BUILD_VERSION::0.0.0-master.`git rev-parse --short HEAD` + + - name: Wait until the package is available + uses: nick-invision/retry@v2 + with: + command: curl -f -s https://registry.npmjs.org/@jesec/flood/${{ steps.parse_version.outputs.BUILD_VERSION }} &>/dev/null + timeout_minutes: 30 + max_attempts: 15 + retry_wait_seconds: 15 - name: Publish flood to Docker Hub uses: docker/build-push-action@v2 with: + build-args: PACKAGE=@jesec/flood VERSION=${{ steps.parse_version.outputs.BUILD_VERSION }} context: . - file: ./Dockerfile + file: ./Dockerfile.release platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: jesec/flood:master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 49a44816..0e67e115 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,6 +50,7 @@ jobs: dist-pkg/flood-win.exe release-docker: + needs: release runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -77,11 +78,20 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Wait until the package is available + uses: nick-invision/retry@v2 + with: + command: curl -f -s https://registry.npmjs.org/flood/${{ steps.parse_semver.outputs.FULL_VERSION }} &>/dev/null + timeout_minutes: 30 + max_attempts: 15 + retry_wait_seconds: 15 + - name: Publish to Docker Hub uses: docker/build-push-action@v2 with: + build-args: VERSION=${{ steps.parse_semver.outputs.FULL_VERSION }} context: . - file: ./Dockerfile + file: ./Dockerfile.release platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: |