Skip to content

Commit

Permalink
Release v2 (#321)
Browse files Browse the repository at this point in the history
* Release v2

* Add doc

* Fix
  • Loading branch information
int128 committed Dec 17, 2023
1 parent 2ad34f8 commit 346d862
Show file tree
Hide file tree
Showing 9 changed files with 282 additions and 617 deletions.
77 changes: 36 additions & 41 deletions .github/workflows/e2e-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,30 @@ on:
- .github/workflows/e2e-docker.yaml

jobs:
build:
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 # v5.3.0
id: metadata
with:
images: ghcr.io/${{ github.repository }}/e2e
# avoid overwriting the latest tag because metadata-action does not add a suffix to it
flavor: latest=false,suffix=-${{ matrix.platform }}
- uses: int128/docker-build-cache-config-action@1ae274f683e01b2b3eb290167f51590fd7035316 # v1.28.0
id: cache
with:
image: ghcr.io/${{ github.repository }}/e2e/cache
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
push: true
context: tests/fixtures
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-linux-amd64:
uses: ./.github/workflows/reusable--docker-build.yaml
with:
images: ghcr.io/${{ github.repository }}/e2e
cache-image: ghcr.io/${{ github.repository }}/e2e/cache
context: tests/fixtures
platforms: linux/amd64

build-linux-arm64:
uses: ./.github/workflows/reusable--docker-build.yaml
with:
images: ghcr.io/${{ github.repository }}/e2e
cache-image: ghcr.io/${{ github.repository }}/e2e/cache
context: tests/fixtures
platforms: linux/arm64

build-multi-architecture:
build:
needs:
- build
- build-linux-amd64
- build-linux-arm64
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
image-uri: ghcr.io/${{ github.repository }}/e2e@${{ steps.build.outputs.digest }}
steps:
# build the action
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -85,9 +67,22 @@ jobs:
with:
images: ghcr.io/${{ github.repository }}/e2e
- name: docker-manifest-create-action
id: build
uses: ./
with:
tags: ${{ steps.metadata.outputs.tags }}
suffixes: |
-linux-amd64
-linux-arm64
sources: |
${{ needs.build-linux-amd64.outputs.image-uri }}
${{ needs.build-linux-arm64.outputs.image-uri }}
test-image:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker run --rm '${{ needs.build.outputs.image-uri }}'
38 changes: 25 additions & 13 deletions .github/workflows/e2e-kaniko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ on:
- .github/workflows/e2e-kaniko.yaml

jobs:
build:
strategy:
fail-fast: false
matrix:
platform:
- amd64
#- arm64
build-linux-amd64:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
image-uri: ghcr.io/${{ github.repository }}/e2e@${{ steps.build.outputs.digest }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
Expand All @@ -42,19 +38,22 @@ jobs:
with:
images: ghcr.io/${{ github.repository }}/e2e
# avoid overwriting the latest tag because metadata-action does not add a suffix to it
flavor: latest=false,suffix=-kaniko-${{ matrix.platform }}
flavor: latest=false,suffix=-kaniko-amd64
- uses: int128/kaniko-action@eb4404462292acd60e2395278949aeb09ed12908 # v1.34.0
id: build
with:
push: true
context: tests/fixtures
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}

build-multi-architecture:
build:
needs:
- build
- build-linux-amd64
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
image-uri: ghcr.io/${{ github.repository }}/e2e@${{ steps.build.outputs.digest }}
steps:
# build the action
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -77,9 +76,22 @@ jobs:
with:
images: ghcr.io/${{ github.repository }}/e2e
flavor: latest=false,suffix=-kaniko
- name: docker-manifest-create-action
- name: docker-manifest-create-action@v2
id: build
uses: ./
with:
tags: ${{ steps.metadata.outputs.tags }}
suffixes: |
-amd64
sources: |
${{ needs.build-linux-amd64.outputs.image-uri }}
test-image:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker run --rm '${{ needs.build.outputs.image-uri }}'
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ jobs:
- run: yarn build
- run: yarn package
- uses: int128/release-typescript-action@94c45715849473c37ebdc66190c9ec4c9543e46b # v1.27.0
with:
major-version: 2
60 changes: 60 additions & 0 deletions .github/workflows/reusable--docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: docker-build

on:
workflow_call:
inputs:
images:
description: Passed to docker/metadata-action
type: string
required: true
cache-image:
description: Passed to int128/docker-build-cache-config-action
type: string
required: true
context:
description: Passed to docker/build-push-action
type: string
required: true
platforms:
description: Passed to docker/build-push-action
type: string
required: true
outputs:
image-uri:
description: Image URI
value: ${{ jobs.build.outputs.image-uri }}

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
image-uri: ghcr.io/${{ github.repository }}/e2e@${{ steps.build.outputs.digest }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 # v5.3.0
id: metadata
with:
images: ${{ inputs.images }}
# avoid overwriting the latest tag because metadata-action does not add a suffix to it
flavor: latest=false,suffix=-amd64
- uses: int128/docker-build-cache-config-action@1ae274f683e01b2b3eb290167f51590fd7035316 # v1.28.0
id: cache
with:
image: ${{ inputs.cache-image }}
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
id: build
with:
push: true
context: ${{ inputs.context }}
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: ${{ inputs.platforms }}
Loading

0 comments on commit 346d862

Please sign in to comment.