|
1 | | -name: Build & Push Container Images |
| 1 | +name: Build and Push Container Images |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
16 | 16 | description: "The ref to build a container image from. For example a tag v23.0.0." |
17 | 17 | required: true |
18 | 18 |
|
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ inputs.ref-name || github.ref }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
19 | 23 | jobs: |
20 | 24 | build: |
21 | | - name: Build and Push to Greenbone Registry |
22 | | - uses: greenbone/workflows/.github/workflows/container-build-push-2nd-gen.yml@main |
| 25 | + if: ${{ github.repository == 'greenbone/gvm-tools' }} |
| 26 | + name: Build and Push Container Images |
| 27 | + uses: greenbone/workflows/.github/workflows/container-build-push-gea.yml@main |
23 | 28 | with: |
24 | | - build-docker-file: .docker/Dockerfile |
25 | | - image-url: community/gvm-tools |
26 | | - image-labels: | |
| 29 | + ref: ${{ inputs.ref-name }} |
| 30 | + ref-name: ${{ inputs.ref-name }} |
| 31 | + dockerfile: .docker/Dockerfile |
| 32 | + images: | |
| 33 | + ghcr.io/${{ github.repository }},enable=true |
| 34 | + ${{ vars.GREENBONE_REGISTRY }}/community/${{ github.event.repository.name }},enable=${{ github.event_name != 'pull_request' }} |
| 35 | + labels: | |
27 | 36 | org.opencontainers.image.vendor=Greenbone |
28 | 37 | org.opencontainers.image.documentation=https://greenbone.github.io/gvm-tools/ |
29 | 38 | org.opencontainers.image.base.name=debian/stable-slim |
30 | | - ref-name: ${{ inputs.ref-name }} |
31 | 39 | secrets: inherit |
| 40 | + |
| 41 | + notify: |
| 42 | + needs: |
| 43 | + - build |
| 44 | + if: ${{ !cancelled() && github.event_name != 'pull_request' && github.repository == 'greenbone/gvm-tools' }} |
| 45 | + uses: greenbone/workflows/.github/workflows/notify-mattermost-2nd-gen.yml@main |
| 46 | + with: |
| 47 | + status: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} |
| 48 | + secrets: inherit |
| 49 | + |
| 50 | + trigger-replication: |
| 51 | + needs: |
| 52 | + - build |
| 53 | + if: ${{ !cancelled() && github.event_name != 'pull_request' && github.repository == 'greenbone/gvm-tools' }} |
| 54 | + runs-on: self-hosted-generic |
| 55 | + steps: |
| 56 | + - name: Ensure all tags are replicated on the public registry |
| 57 | + uses: greenbone/actions/trigger-harbor-replication@v3 |
| 58 | + if: ${{ github.event_name != 'pull_request' }} |
| 59 | + with: |
| 60 | + registry: ${{ vars.GREENBONE_REGISTRY }} |
| 61 | + token: ${{ secrets.GREENBONE_REGISTRY_REPLICATION_TOKEN }} |
| 62 | + user: ${{ secrets.GREENBONE_REGISTRY_REPLICATION_USER }} |
0 commit comments