|
22 | 22 | - name: Set up Go 1.x |
23 | 23 | uses: actions/setup-go@v5 |
24 | 24 | with: |
25 | | - go-version: 1.20.7 |
| 25 | + go-version: 1.23.6 |
26 | 26 | id: go |
27 | 27 |
|
28 | 28 | - name: Get dependencies |
@@ -52,20 +52,44 @@ jobs: |
52 | 52 | username: ${{ secrets.DOCKERHUB_USERNAME }} |
53 | 53 | password: ${{ secrets.DOCKERHUB_TOKEN }} |
54 | 54 |
|
55 | | - - name: Extract metadata (tags, labels) for Docker |
56 | | - id: meta |
| 55 | + - name: Extract metadata (tags, labels) for released releases |
| 56 | + if: ${{ github.event.release.prerelease == false }} |
| 57 | + id: meta_released |
57 | 58 | uses: docker/metadata-action@v5 |
58 | 59 | with: |
59 | 60 | images: multiversx/chainsimulator |
60 | 61 |
|
61 | | - - name: Build and push Docker image |
62 | | - id: push |
| 62 | + - name: Extract metadata (tags, labels) for prereleased releases |
| 63 | + if: ${{ github.event.release.prerelease == true }} |
| 64 | + id: meta_prereleased |
| 65 | + uses: docker/metadata-action@v5 |
| 66 | + with: |
| 67 | + images: multiversx/chainsimulator |
| 68 | + tags: | |
| 69 | + type=raw,value=${{ github.event.release.tag_name }} |
| 70 | + labels: | |
| 71 | + type=raw,value=${{ github.event.release.name }} |
| 72 | +
|
| 73 | + - name: Build and push Docker image for released |
| 74 | + if: ${{ github.event.release.prerelease == false }} |
| 75 | + id: push_released |
63 | 76 | uses: docker/build-push-action@v6 |
64 | 77 | with: |
65 | 78 | context: . |
66 | 79 | file: ./Dockerfile |
67 | | - platforms: linux/amd64,linux/arm64 |
68 | | - push: ${{ github.event_name != 'pull_request' }} |
69 | | - tags: ${{ steps.meta.outputs.tags }} |
70 | | - labels: ${{ steps.meta.outputs.labels }} |
| 80 | + platforms: ${{ matrix.platform }} |
| 81 | + push: ${{ github.event_name == 'release' && github.event.action == 'published' }} |
| 82 | + tags: ${{ steps.meta_released.outputs.tags }} |
| 83 | + labels: ${{ steps.meta_released.outputs.labels }} |
71 | 84 |
|
| 85 | + - name: Build and push Docker image for prereleased |
| 86 | + if: ${{ github.event.release.prerelease == true }} |
| 87 | + id: push_prereleased |
| 88 | + uses: docker/build-push-action@v6 |
| 89 | + with: |
| 90 | + context: . |
| 91 | + file: ./Dockerfile |
| 92 | + platforms: linux/amd64,linux/arm64 |
| 93 | + push: ${{ github.event_name == 'release' && github.event.action == 'published' }} |
| 94 | + tags: ${{ steps.meta_prereleased.outputs.tags }} |
| 95 | + labels: ${{ steps.meta_prereleased.outputs.labels }} |
0 commit comments