|
6 | 6 |
|
7 | 7 | jobs:
|
8 | 8 | release:
|
| 9 | + name: Create release |
9 | 10 | runs-on: ubuntu-latest
|
10 | 11 |
|
11 | 12 | steps:
|
|
20 | 21 | - run: gh release create v${{ steps.versions.outputs.changelog-latest-version }} go/dist/*
|
21 | 22 | env:
|
22 | 23 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 24 | + |
| 25 | + outputs: |
| 26 | + latest-release: ${{ steps.versions.outputs.changelog-latest-version }} |
| 27 | + |
| 28 | + docker: |
| 29 | + name: Publish docker images |
| 30 | + runs-on: ubuntu-latest |
| 31 | + needs: release |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Download binaries |
| 35 | + id: download |
| 36 | + run: | |
| 37 | + gh release download -D /tmp/binaries -R ${{ github.repository }} v${{ needs.release.outputs.latest-release }} |
| 38 | + |
| 39 | + echo ::set-output name=binary-directory::/tmp/binaries |
| 40 | + |
| 41 | + echo "::group::Downloaded" |
| 42 | + ls -al /tmp/binaries |
| 43 | + echo "::endgroup::" |
| 44 | + env: |
| 45 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + |
| 47 | + - uses: docker/setup-qemu-action@v1 |
| 48 | + |
| 49 | + - uses: docker/setup-buildx-action@v1 |
| 50 | + |
| 51 | + - uses: docker/metadata-action@v4 |
| 52 | + id: meta |
| 53 | + with: |
| 54 | + tags: | |
| 55 | + type=semver,value=${{ needs.release.outputs.latest-release }},pattern={{major}}.{{minor}}.{{patch}} |
| 56 | + type=semver,value=${{ needs.release.outputs.latest-release }},pattern={{major}}.{{minor}} |
| 57 | + type=semver,value=${{ needs.release.outputs.latest-release }},pattern={{major}} |
| 58 | + images: ${{ github.repository }} |
| 59 | + |
| 60 | + - uses: docker/login-action@v2 |
| 61 | + with: |
| 62 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 63 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 64 | + |
| 65 | + - uses: docker/build-push-action@v3 |
| 66 | + with: |
| 67 | + context: "{{defaultContext}}:docker" |
| 68 | + push: true |
| 69 | + platforms: | |
| 70 | + linux/386 |
| 71 | + linux/arm |
| 72 | + linux/amd64 |
| 73 | + linux/arm64 |
| 74 | + tags: ${{ steps.meta.outputs.tags }} |
| 75 | + labels: ${{ steps.meta.outputs.labels }} |
| 76 | + build-contexts: | |
| 77 | + binaries=${{ steps.download.outputs.binary-directory }} |
0 commit comments