Skip to content

Commit

Permalink
feat: build hashed images in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgeron committed Oct 23, 2024
1 parent eb1776c commit 378b6d8
Showing 1 changed file with 78 additions and 2 deletions.
80 changes: 78 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
build-fuel-bridge:
name: Build and Push fuel-bridge Image
runs-on: buildjet-4vcpu-ubuntu-2204
if: |
(github.event_name == 'release' && github.event.action == 'published') ||
github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3

Expand All @@ -38,13 +41,50 @@ jobs:
with:
context: .
push: true
tags: ghcr.io/fuellabs/fuel-bridge:${{ github.event.pull_request.base.sha }}
tags: ghcr.io/fuellabs/fuel-bridge:latest
file: docker/l1-chain/Dockerfile
platforms: linux/amd64,linux/arm64
build-fuel-bridge-hashed:
name: Build and Push fuel-bridge Image hashed tag
runs-on: buildjet-4vcpu-ubuntu-2204
if: |
(github.event_name == 'release' && github.event.action == 'published') ||
github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: short_sha
run: echo "::set-output name=SHORT_SHA::${GITHUB_SHA::7}"

- name: Build and push multi-arch fuel-bridge image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/fuellabs/fuel-bridge:${{ steps.short_sha.outputs.SHORT_SHA }}
file: docker/l1-chain/Dockerfile
platforms: linux/amd64,linux/arm64

build-fuel-bridge-full:
name: Build and Push fuel-bridge-full Image
runs-on: buildjet-4vcpu-ubuntu-2204
if: |
(github.event_name == 'release' && github.event.action == 'published') ||
github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3

Expand All @@ -66,6 +106,42 @@ jobs:
with:
context: .
push: true
tags: ghcr.io/fuellabs/fuel-bridge-full:${{ github.event.pull_request.base.sha }}
tags: ghcr.io/fuellabs/fuel-bridge-full:latest
file: docker/full-env/Dockerfile
platforms: linux/amd64,linux/arm64

build-fuel-bridge-full-hashed:
name: Build and Push fuel-bridge-full Image hashed tag
runs-on: buildjet-4vcpu-ubuntu-2204
if: |
(github.event_name == 'release' && github.event.action == 'published') ||
github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: short_sha
run: echo "::set-output name=SHORT_SHA::${GITHUB_SHA::7}"

- name: Build and push multi-arch fuel-bridge-full image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/fuellabs/fuel-bridge:${{ steps.short_sha.outputs.SHORT_SHA }}
file: docker/full-env/Dockerfile
platforms: linux/amd64,linux/arm64

0 comments on commit 378b6d8

Please sign in to comment.