Bump the go-dependencies group with 17 updates #1429
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Build docker image | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| workflow_run: | |
| workflows: ["Release"] | |
| types: [completed] | |
| branches: [main] | |
| pull_request: | |
| env: | |
| IMAGE_NAME: netbox-operator | |
| DOCKER_METADATA_PR_HEAD_SHA: true | |
| jobs: | |
| push: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name != 'workflow_run' }} | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v5.0.0 | |
| with: | |
| fetch-tags: true | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get tag information | |
| id: tag_info | |
| run: | | |
| LATEST_TAG=$(git tag --points-at HEAD || echo "no-tag") | |
| # if LATEST_TAG is empty set it to "no-tag" | |
| if [ -z "$LATEST_TAG" ]; then | |
| LATEST_TAG="no-tag" | |
| fi | |
| echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT | |
| - name: Generate docker image tag | |
| id: meta | |
| uses: docker/[email protected] | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| # (for commits on the main branch only) generate a tag named `latest` | |
| type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
| # (for all commits) generate a tag named sha-[short sha value] | |
| type=sha,enable=true | |
| # (for tagged commits only) generate tags identical to the git tag version, with and without the leading v | |
| type=semver,pattern={{raw}},enable=${{ steps.tag_info.outputs.latest_tag != 'no-tag' }},value=${{ steps.tag_info.outputs.latest_tag }} | |
| type=semver,pattern={{version}},enable=${{ steps.tag_info.outputs.latest_tag != 'no-tag' }},value=${{ steps.tag_info.outputs.latest_tag }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| # we push only if the pipeline is run against the commits on main branch or a tag | |
| push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |