mirror of
https://github.com/codex-storage/bittorrent-benchmarks.git
synced 2025-02-02 22:33:44 +00:00
docker: add multi-arch builds
This commit is contained in:
parent
d417f55ffd
commit
ba96ad3a69
49
.github/workflows/argo.yaml
vendored
49
.github/workflows/argo.yaml
vendored
@ -1,49 +0,0 @@
|
||||
name: Build Argo Workflows Runner Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DOCKER_FILE: ./docker/bittorrent-benchmarks-workflows.Dockerfile
|
||||
DOCKER_REPO: codexstorage/bittorrent-benchmarks-workflows
|
||||
|
||||
jobs:
|
||||
test-and-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Setup Docker Metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.DOCKER_REPO }}
|
||||
flavor: |
|
||||
latest=true
|
||||
tags: |
|
||||
type=sha
|
||||
|
||||
- name: Build and Push Prod. Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ env.DOCKER_FILE }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
|
52
.github/workflows/argo.yml
vendored
Normal file
52
.github/workflows/argo.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
name: Build Argo Workflows Runner Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DOCKER_FILE: ./docker/bittorrent-benchmarks-workflows.Dockerfile
|
||||
DOCKER_REPO: codexstorage/bittorrent-benchmarks-workflows
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: Build and Test
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build Test Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ env.DOCKER_FILE }}
|
||||
push: false
|
||||
|
||||
variables:
|
||||
name: Compute outputs
|
||||
needs: build-and-test
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
docker_file: ${{ env.DOCKER_FILE }}
|
||||
dockerhub_repo: ${{ env.DOCKER_REPO }}
|
||||
steps:
|
||||
- name: Dummy job
|
||||
if: false
|
||||
run: echo
|
||||
|
||||
build-and-push:
|
||||
name: Build and Push
|
||||
needs: variables
|
||||
uses: codex-storage/github-actions/.github/workflows/docker-reusable.yml@master
|
||||
with:
|
||||
docker_file: ${{ needs.variables.outputs.docker_file }}
|
||||
dockerhub_repo: ${{ needs.variables.outputs.dockerhub_repo }}
|
||||
secrets: inherit
|
57
.github/workflows/ci.yml
vendored
57
.github/workflows/ci.yml
vendored
@ -4,15 +4,19 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DOCKER_FILE: ./docker/bittorrent-benchmarks.Dockerfile
|
||||
DOCKER_REPO: codexstorage/bittorrent-benchmarks
|
||||
BUILD_ARGS: |
|
||||
BUILD_TYPE=test
|
||||
|
||||
jobs:
|
||||
test-and-build:
|
||||
build-and-test:
|
||||
name: Build and Test
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -21,22 +25,6 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Setup Docker Metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.DOCKER_REPO }}
|
||||
flavor: |
|
||||
latest=true
|
||||
tags: |
|
||||
type=sha
|
||||
|
||||
- name: Build Test Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
@ -46,7 +34,7 @@ jobs:
|
||||
load: true
|
||||
tags: bittorrent-benchmarks:test
|
||||
build-args: |
|
||||
BUILD_TYPE=test
|
||||
${{ env.BUILD_ARGS }}
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
@ -64,11 +52,26 @@ jobs:
|
||||
run: |
|
||||
docker compose -f docker-compose.local.yaml -f docker-compose.ci.yaml up --abort-on-container-exit --exit-code-from test-runner
|
||||
|
||||
- name: Build and Push Prod. Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ env.DOCKER_FILE }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
variables:
|
||||
name: Compute outputs
|
||||
needs: build-and-test
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
docker_file: ${{ env.DOCKER_FILE }}
|
||||
dockerhub_repo: ${{ env.DOCKER_REPO }}
|
||||
build_args: ${{ env.BUILD_ARGS }}
|
||||
steps:
|
||||
- name: Dummy job
|
||||
if: false
|
||||
run: echo
|
||||
|
||||
build-and-push:
|
||||
name: Build and Push
|
||||
needs: variables
|
||||
uses: codex-storage/github-actions/.github/workflows/docker-reusable.yml@master
|
||||
with:
|
||||
docker_file: ${{ needs.variables.outputs.docker_file }}
|
||||
dockerhub_repo: ${{ needs.variables.outputs.dockerhub_repo }}
|
||||
build_args: |
|
||||
${{ needs.variables.outputs.build_args }}
|
||||
secrets: inherit
|
||||
|
Loading…
x
Reference in New Issue
Block a user