chore(main): release 4.1.0 #615
This file contains 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 & Push | |
on: | |
merge_group: | |
pull_request: | |
push: | |
tags: ["v*.*.*"] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
pull-requests: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0 | |
if: ${{ github.event_name != 'merge_group' }} | |
- uses: docker/metadata-action@e6428a5c4e294a61438ed7f43155db912025b6b3 # v5.2.0 | |
id: meta | |
env: | |
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository }} | |
# Generate Docker tags based on the following events/attributes | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=ref,event=pr | |
type=semver,pattern={{raw}} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
with: | |
version: v0.12.0 | |
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
if: ${{ github.event_name != 'merge_group' }} | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 | |
id: build-and-push | |
with: | |
file: .devcontainer/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'merge_group' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
annotations: ${{ steps.meta.outputs.annotations }} | |
sbom: true | |
provenance: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- uses: anchore/sbom-action@fd74a6fb98a204a1ad35bbfae0122c1a302ff88b # v0.15.0 | |
if: ${{ steps.build-and-push.outputs.digest != '' && github.event_name != 'merge_group' }} | |
with: | |
image: ${{ env.REGISTRY }}/${{ github.repository }}@${{ steps.build-and-push.outputs.digest }} | |
dependency-snapshot: true | |
- uses: actions/dependency-review-action@01bc87099ba56df1e897b6874784491ea6309bc4 # v3.1.4 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
comment-summary-in-pr: on-failure | |
fail-on-severity: critical | |
- name: Sign the image with GitHub OIDC token | |
if: ${{ github.event_name != 'merge_group' }} | |
# This step uses the GitHub OIDC identity token to provision an ephemeral certificate | |
# against the sigstore community Fulcio instance. | |
env: | |
DIGEST: ${{ steps.build-and-push.outputs.digest }} | |
TAGS: ${{ steps.meta.outputs.tags }} | |
run: echo "${TAGS}" | xargs -I {} cosign sign --yes "{}@${DIGEST}" |