Say it with me now, all hail the matrix.
This commit is contained in:
parent
3675824d44
commit
048637f624
2 changed files with 39 additions and 22 deletions
.github/workflows
28
.github/workflows/ghcr-cleanup.yml
vendored
Normal file
28
.github/workflows/ghcr-cleanup.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
name: "Cleanup"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Build Swarm Connectivity Tester"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cleanup:
|
||||||
|
name: Delete untagged images
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: docker login ghcr.io -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- uses: vlaurin/action-ghcr-prune@v0.6.0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
organization: ${{ github.repository_owner }}
|
||||||
|
container: swarm-connectivity-tester
|
||||||
|
dry-run: true
|
||||||
|
keep-younger-than: 7 # days
|
||||||
|
keep-last: 2
|
||||||
|
prune-untagged: true
|
33
.github/workflows/swarm-connectivity-tester.yml
vendored
33
.github/workflows/swarm-connectivity-tester.yml
vendored
|
@ -24,6 +24,11 @@ jobs:
|
||||||
swarm-connectivity-tester-build:
|
swarm-connectivity-tester-build:
|
||||||
name: Build Swarm Connectivity Tester
|
name: Build Swarm Connectivity Tester
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
component:
|
||||||
|
- target
|
||||||
|
- reporter
|
||||||
steps:
|
steps:
|
||||||
- uses: benzine-framework/action-setup-php@main
|
- uses: benzine-framework/action-setup-php@main
|
||||||
- uses: benzine-framework/action-get-datetime@main
|
- uses: benzine-framework/action-get-datetime@main
|
||||||
|
@ -31,37 +36,21 @@ jobs:
|
||||||
with:
|
with:
|
||||||
ghcr_user: matthewbaggett
|
ghcr_user: matthewbaggett
|
||||||
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
|
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
docker_hub_user: matthewbaggett
|
||||||
- name: "Build: Build & Push Target Image"
|
docker_hub_token: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
uses: docker/build-push-action@v5
|
- uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
target: connect-target
|
target: connect-${{ matrix.component }}
|
||||||
platforms: ${{ github.actor != 'nektos/act' && env.PLATFORMS || 'linux/amd64' }}
|
platforms: ${{ github.actor != 'nektos/act' && env.PLATFORMS || 'linux/amd64' }}
|
||||||
pull: true
|
pull: true
|
||||||
push: ${{ github.ref == 'refs/heads/main' }}
|
push: ${{ github.ref == 'refs/heads/main' }}
|
||||||
tags: |
|
tags: |
|
||||||
benzine/swarm-connectivity-tester:target
|
benzine/swarm-connectivity-tester:${{ matrix.component }}
|
||||||
ghcr.io/benzine-framework/swarm-connectivity-tester:target
|
ghcr.io/benzine-framework/swarm-connectivity-tester:${{ matrix.component }}
|
||||||
cache-from: ${{ env.DOCKER_CACHE_FROM }}
|
cache-from: ${{ env.DOCKER_CACHE_FROM }}
|
||||||
cache-to: ${{ env.DOCKER_CACHE_TO }}
|
cache-to: ${{ env.DOCKER_CACHE_TO }}
|
||||||
build-contexts: |
|
build-contexts: |
|
||||||
php:cli=docker-image://ghcr.io/benzine-framework/php:cli-8.2
|
php:cli=docker-image://ghcr.io/benzine-framework/php:cli-8.2
|
||||||
php:nginx=docker-image://ghcr.io/benzine-framework/php:nginx-8.2
|
php:nginx=docker-image://ghcr.io/benzine-framework/php:nginx-8.2
|
||||||
|
|
||||||
- name: "Build: Build & Push Report Image"
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
target: connect-reporter
|
|
||||||
platforms: ${{ github.actor != 'nektos/act' && env.PLATFORMS || 'linux/amd64' }}
|
|
||||||
pull: true
|
|
||||||
push: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
tags: |
|
|
||||||
benzine/swarm-connectivity-tester:reporter
|
|
||||||
ghcr.io/benzine-framework/swarm-connectivity-tester:reporter
|
|
||||||
cache-from: ${{ env.DOCKER_CACHE_FROM }}
|
|
||||||
cache-to: ${{ env.DOCKER_CACHE_TO }}
|
|
||||||
build-contexts: |
|
|
||||||
php:cli=docker-image://ghcr.io/benzine-framework/php:cli-8.2
|
|
||||||
php:nginx=docker-image://ghcr.io/benzine-framework/php:nginx-8.2
|
|
||||||
|
|
Loading…
Reference in a new issue