Skip to content

Commit

Permalink
test docker matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Aug 25, 2024
1 parent c874f18 commit 8484c74
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/publish-docker-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,47 @@ name: Build and Publish Next Docker Image
on:
push:
branches:
- master
- test-docker-matrix

permissions:
packages: write

jobs:
publish-docker-next:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [amd64, arm64]

steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
platforms: linux/${{ matrix.architecture }}

- name: Set Git Short SHA
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Build and push to DockerHub
id: docker_build_push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: shieldsio/shields:next
build-args: |
version=${{ env.SHORT_SHA }}
- name: Output Image Digest
run: echo ${{ steps.docker_build_push.outputs.digest }} >> $GITHUB_STEP_SUMMARY

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push to GHCR
- name: Build and push to GHCR#
id: docker_build_push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/badges/shields:next
platforms: linux/${{ matrix.architecture }}
tags: ghcr.io/chris48s/shields:next
build-args: |
version=${{ env.SHORT_SHA }}
- name: Output Image Digest
run: echo ${{ steps.docker_build_push.outputs.digest }} >> $GITHUB_STEP_SUMMARY

0 comments on commit 8484c74

Please sign in to comment.