mirror of
https://github.com/int128/kubelogin.git
synced 2026-08-23 21:06:15 +00:00
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: docker
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- .github/workflows/docker.yaml
|
|
- pkg/**
|
|
- go.*
|
|
- Dockerfile
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- .github/workflows/docker.yaml
|
|
- pkg/**
|
|
- go.*
|
|
- Dockerfile
|
|
tags:
|
|
- v*
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
outputs:
|
|
image-uri: ${{ steps.build-metadata.outputs.image-uri }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
|
|
id: metadata
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
- uses: int128/docker-build-cache-config-action@30418889212165632e9bd9fd7604f1800f85a86f # v1.67.0
|
|
id: cache
|
|
with:
|
|
image: ghcr.io/${{ github.repository }}/cache
|
|
- uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
|
|
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
|
|
- uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
|
id: build
|
|
with:
|
|
push: ${{ github.event_name == 'push' }}
|
|
tags: ${{ steps.metadata.outputs.tags }}
|
|
labels: ${{ steps.metadata.outputs.labels }}
|
|
cache-from: ${{ steps.cache.outputs.cache-from }}
|
|
cache-to: ${{ steps.cache.outputs.cache-to }}
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm64
|
|
linux/ppc64le
|
|
- uses: int128/docker-build-metadata-action@55ad08a6cbdc37548101f7b6569fefd722e50bb3 # v2.6.0
|
|
id: build-metadata
|
|
with:
|
|
tags: ${{ steps.metadata.outputs.tags }}
|
|
digest: ${{ steps.build.outputs.digest }}
|
|
|
|
test:
|
|
if: needs.build.outputs.image-uri != ''
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- run: docker run --rm "$IMAGE_URI" --help
|
|
env:
|
|
IMAGE_URI: ${{ needs.build.outputs.image-uri }}
|