mirror of
https://github.com/int128/kubelogin.git
synced 2026-05-20 23:02:50 +00:00
* Build multi platforms in parallel * Fix suffix * docker pull * Push [DO NOT MERGE] * Add linux prefix * Use int128/docker-manifest-create-action * Fix latest * Remove push
85 lines
2.1 KiB
YAML
85 lines
2.1 KiB
YAML
name: docker
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- .github/workflows/docker.yaml
|
|
- pkg/**
|
|
- go.*
|
|
- Dockerfile
|
|
- Makefile
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- .github/workflows/docker.yaml
|
|
- pkg/**
|
|
- go.*
|
|
- Dockerfile
|
|
- Makefile
|
|
tags:
|
|
- v*
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
- linux/ppc64le
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: docker/metadata-action@v4
|
|
id: metadata
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
flavor: suffix=-${{ matrix.platform }}
|
|
- uses: int128/docker-build-cache-config-action@v1
|
|
id: cache
|
|
with:
|
|
image: ghcr.io/${{ github.repository }}/cache
|
|
- uses: docker/setup-qemu-action@v2
|
|
- uses: docker/setup-buildx-action@v2
|
|
- uses: docker/build-push-action@v3
|
|
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: ${{ matrix.platform }}
|
|
|
|
build-multi-architecture:
|
|
needs:
|
|
- build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: docker/metadata-action@v4
|
|
id: metadata
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
- uses: int128/docker-manifest-create-action@v1
|
|
with:
|
|
tags: ${{ steps.metadata.outputs.tags }}
|
|
suffixes: |
|
|
-linux-amd64
|
|
-linux-arm64
|
|
-linux-ppc64le
|