|
| 1 | +name: Build & push Docker image |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + dist-artifact-name: |
| 7 | + type: string |
| 8 | + required: true |
| 9 | + push: |
| 10 | + type: boolean |
| 11 | + required: false |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - uses: actions/download-artifact@v4 |
| 20 | + with: |
| 21 | + name: ${{ inputs.dist-artifact-name }} |
| 22 | + - run: | |
| 23 | + mkdir -p dist |
| 24 | + unzip -q ${{ inputs.dist-artifact-name }} -d dist |
| 25 | +
|
| 26 | + - name: Set up QEMU |
| 27 | + uses: docker/setup-qemu-action@v3 |
| 28 | + |
| 29 | + - name: Set up Docker Buildx |
| 30 | + id: buildx |
| 31 | + uses: docker/setup-buildx-action@v3 |
| 32 | + |
| 33 | + - name: Login to Docker Hub |
| 34 | + uses: docker/login-action@v3 |
| 35 | + with: |
| 36 | + username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} |
| 37 | + password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} |
| 38 | + |
| 39 | + - name: Docker meta |
| 40 | + id: metadata |
| 41 | + uses: docker/metadata-action@v5 |
| 42 | + with: |
| 43 | + images: digmaai/jaeger-ui |
| 44 | + tags: | |
| 45 | + type=schedule |
| 46 | + type=ref,event=branch |
| 47 | + type=ref,event=pr |
| 48 | + type=match,pattern=v(.*),group=1 |
| 49 | + type=semver,pattern={{version}} |
| 50 | + type=semver,pattern={{major}}.{{minor}} |
| 51 | + type=semver,pattern={{major}} |
| 52 | + type=sha |
| 53 | + # set latest tag for digma branch |
| 54 | + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} |
| 55 | +
|
| 56 | + - name: Build and push |
| 57 | + if: ${{ inputs.push == 'true' }} |
| 58 | + uses: docker/build-push-action@v6 |
| 59 | + with: |
| 60 | + context: . |
| 61 | + file: ./Dockerfile |
| 62 | + platforms: linux/amd64,linux/arm64 |
| 63 | + push: ${{ inputs.push }} |
| 64 | + tags: ${{ steps.metadata.outputs.tags }} |
| 65 | + labels: ${{ steps.metadata.outputs.labels }} |
0 commit comments