Skip to content

Commit

Permalink
Integrate multi push with matrix build
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Feb 2, 2024
1 parent 6b0991b commit 81b3eac
Showing 1 changed file with 4 additions and 60 deletions.
64 changes: 4 additions & 60 deletions .github/workflows/build_multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,66 +143,10 @@ jobs:
push_tags: "${{ env.push_tags }}"

deploy_multiarch:
runs-on: ubuntu-latest

needs:
- build_amd64
- build_arm64

env:
ruby_version: "${{ inputs.ruby_version }}"
ubuntu_version: "${{ inputs.ubuntu_version }}"
registry_name: rubylang

steps:
- uses: actions/[email protected]

- name: Login to ${{ env.registry_name }}
run: |-
case x"${{ env.registry_name }}" in
xrubylang)
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
;;
xghcr.io/ruby)
echo $GHCR_ACCESS_TOKEN | docker login ghcr.io -u $GHCR_USER --password-stdin
;;
*)
echo "ERROR: Unknown registry_name parameter: $registry_name" >&2
exit 1
;;
esac
- name: Create manifest for ${{ env.registry_name }}
run: |-
rake docker:manifest:create \
registry_name="${{ env.registry_name }}" \
ruby_version="${{ env.ruby_version }}" \
ubuntu_version="${{ env.ubuntu_version }}" \
architectures="amd64 arm64" \
manifest_suffix=${{ github.sha }} \
latest_tag=true
rake docker:manifest:create \
registry_name="${{ env.registry_name }}" \
ruby_version="${{ env.ruby_version }}" \
ubuntu_version="${{ env.ubuntu_version }}" \
architectures="amd64 arm64" \
image_version_suffix=-dev \
manifest_suffix=${{ github.sha }}
- name: Push manifest to ${{ env.registry_name }}
run: |-
rake docker:manifest:push \
registry_name="${{ env.registry_name }}" \
ruby_version="${{ env.ruby_version }}" \
ubuntu_version="${{ env.ubuntu_version }}" \
latest_tag=true
rake docker:manifest:push \
registry_name="${{ env.registry_name }}" \
ruby_version="${{ env.ruby_version }}" \
ubuntu_version="${{ env.ubuntu_version }}" \
image_version_suffix=-dev
strategy:
matrix:
registry_name: [ rubylang, ghcr.io/ruby ]

deploy_multiarch_ghcr:
runs-on: ubuntu-latest

needs:
Expand All @@ -212,7 +156,7 @@ jobs:
env:
ruby_version: "${{ inputs.ruby_version }}"
ubuntu_version: "${{ inputs.ubuntu_version }}"
registry_name: ghcr.io/ruby
registry_name: "${{ matrix.registry_name }}"

steps:
- uses: actions/[email protected]
Expand Down

0 comments on commit 81b3eac

Please sign in to comment.