Skip to content

Commit

Permalink
Multi-arch image in docker hub (#3975)
Browse files Browse the repository at this point in the history
  • Loading branch information
phearnot authored Oct 24, 2024
1 parent bfbf269 commit 0720c42
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
check-pr:
name: Check PR
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -15,6 +15,7 @@ jobs:
cache: 'sbt'
gpg-private-key: ${{ secrets.OSSRH_GPG_KEY }}
gpg-passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
- uses: sbt/setup-sbt@v1
- name: Check PR
run: sbt -J-Xlog:gc*=debug:file=./gc.log --mem 8096 --batch ";checkPR;completeQaseRun"
env:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ env:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
fetch-tags: true
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- run: sbt --mem 4096 --batch buildTarballsForDocker
- uses: docker/login-action@v3
with:
Expand Down
55 changes: 21 additions & 34 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,83 +7,68 @@ on:
jobs:
publish-node-image:
name: Publish node image
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'sbt'

- name: Build tarballs for Docker
run: sbt --mem 4096 --batch ';buildTarballsForDocker;buildRIDERunnerForDocker'

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Log into Docker Hub registry
uses: docker/login-action@v3
- uses: sbt/setup-sbt@v1
- run: sbt --mem 4096 --batch ';buildTarballsForDocker;buildRIDERunnerForDocker'
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Extract Docker public node metadata
id: meta-public
- id: meta-public
uses: docker/metadata-action@v5
with:
images: wavesplatform/wavesnode
flavor: |
latest=false
flavor: latest=false
tags: |
type=match,pattern=v(.*),group=1
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
- name: Extract Docker private node metadata
id: meta-private
- id: meta-private
uses: docker/metadata-action@v5
with:
images: wavesplatform/waves-private-node
flavor: |
latest=false
flavor: latest=false
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
- name: Extract Docker RIDE runner metadata
id: meta-ride-runner
- id: meta-ride-runner
uses: docker/metadata-action@v5
with:
images: wavesplatform/ride-runner
flavor: |
latest=false
flavor: latest=false
tags: |
type=match,pattern=v(.*),group=1
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
- name: Build and push Docker public image
id: build-and-push-public
uses: docker/build-push-action@v5
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./docker
push: true
pull: true
tags: ${{ steps.meta-public.outputs.tags }}

- name: Build and push Docker private image
id: build-and-push-private
uses: docker/build-push-action@v5
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./docker/private
push: true
pull: true
tags: ${{ steps.meta-private.outputs.tags }}
build-args: |
NODE_TAG=${{ steps.meta-public.outputs.version }}
- name: Build and push Docker RIDE runner image
id: build-and-push-ride-runner
uses: docker/build-push-action@v5
- uses: docker/build-push-action@v5
with:
context: ./ride-runner/docker
push: true
Expand All @@ -92,9 +77,9 @@ jobs:

publish-node-sbt-builder-image:
name: Publish node SBT builder image
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: extract-versions
run: |
echo "waves-version=$(cut -d\" -f2 version.sbt)" >> $GITHUB_OUTPUT
Expand All @@ -106,6 +91,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./docker
file: ./docker/node-sbt-builder.Dockerfile
push: true
Expand All @@ -117,7 +103,7 @@ jobs:
publish-release-jars:
name: Publish jars to Sonatype
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: sbt-version
Expand All @@ -138,6 +124,7 @@ jobs:
cache: 'sbt'
gpg-private-key: ${{ secrets.OSSRH_GPG_KEY }}
gpg-passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
- uses: sbt/setup-sbt@v1
- name: Publish release jars
env:
SONATYPE_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/push-default-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
jobs:
update-graph:
name: Update Dependency Graph
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: scalacenter/sbt-dependency-submission@v3
with:
configs-ignore: test compile-internal provided
publish-snapshot:
name: Publish Snapshots to Sonatype
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -26,6 +26,7 @@ jobs:
cache: 'sbt'
gpg-private-key: ${{ secrets.OSSRH_GPG_KEY }}
gpg-passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
- uses: sbt/setup-sbt@v1
- name: Publish snapshots
env:
SONATYPE_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down

0 comments on commit 0720c42

Please sign in to comment.