Skip to content

deps: lock file maintenance #3073

deps: lock file maintenance

deps: lock file maintenance #3073

Workflow file for this run

name: test
on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:
inputs: # null for another event
skip:
type: boolean
default: false
permissions: {}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# tool versions
# renovate: datasource=github-releases depName=docker/buildx
BUILDX_VERSION: v0.16.2
# renovate: datasource=github-releases depName=moby/buildkit
BUILDKIT_VERSION: v0.15.2
jobs:
test:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- run: |
echo 'FROM scratch' > Dockerfile
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=moby/buildkit:${{ env.BUILDKIT_VERSION }}
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: test-meta
name: Extract metadata (tags, labels) for Docker
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},suffix=-test
type=semver,pattern={{major}}.{{minor}},suffix=-test
type=semver,pattern={{major}},suffix=-test
type=edge,suffix=-test
type=ref,event=branch,suffix=-test
- id: build
name: Build and push Docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
file: 'test.Dockerfile'
push: ${{ github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.test-meta.outputs.tags }}
labels: ${{ steps.test-meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- if: ${{ github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch }}
name: Display image digest
run: |
name=$(cut --delimiter=',' --fields=1 <<< "$NAME")
echo '```' >> $GITHUB_STEP_SUMMARY
echo "$name@$DIGEST" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
env:
NAME: ${{ fromJson(steps.build.outputs.metadata)['image.name'] }}
DIGEST: ${{ fromJson(steps.build.outputs.metadata)['containerimage.digest'] }}