diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index ea39a4b2b..000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Docker image -on: - push: - tags: - - '*' -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout SCM - uses: actions/checkout@v2.4.0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - name: Set Git tag in output - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Build & Push Docker image - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: | - openapitools/openapi-diff:${{ steps.vars.outputs.tag }} - openapitools/openapi-diff:latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a21e3a3a..fc5d8914d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,18 +23,13 @@ jobs: with: distribution: 'zulu' java-version: 11 + cache: 'maven' # Value of the distributionManagement/repository/id field of the pom.xml server-id: sonatype-nexus-staging gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} server-username: OSS_USERNAME server-password: OSS_PASSWORD gpg-passphrase: GPG_PASSPHRASE - - uses: actions/cache@v2.1.6 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - name: Setup Git run: | git config --global committer.email "noreply@github.com" @@ -48,3 +43,24 @@ jobs: run: | ./mvnw -B release:rollback -Prelease -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}} echo "You may need to manually delete the GitHub tag, if it was created." + docker: + needs: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + ref: ${{ github.event.inputs.releaseVersion }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Build & Push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: | + openapitools/openapi-diff:${{ github.event.inputs.releaseVersion }} + openapitools/openapi-diff:latest