Skip to content

Commit

Permalink
Add gha
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew DeVenny <[email protected]>
  • Loading branch information
matthewdevenny committed Oct 2, 2024
1 parent f5d8ae9 commit 555112b
Showing 1 changed file with 49 additions and 54 deletions.
103 changes: 49 additions & 54 deletions .github/workflows/image-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@ jobs:
echo "$download_test_version - failed; skipping" >&2
continue
fi
jsonVersions="${jsonVersions}{\
'command':'${{matrix.image.command}}',\
'version':'${versions[$i]}',\
'latest':'${versions[$((size-1))]}',\
'digest':'$digest',\
'checksum':'${{ steps.baseImage.outputs.checksum }}'}"
if (( $i < ($size-1) )); then
jsonVersions="${jsonVersions},"
fi
Expand Down Expand Up @@ -185,61 +187,54 @@ jobs:
runs-on: ubuntu-latest
needs: [read]
steps:
- run: |
echo ${{ matrix.image.command }}
echo ${{ matrix.image.version }}
echo ${{ matrix.image.digest }}
echo ${{ matrix.image.checksum }}
echo ${{ matrix.image.latest }}
- uses: actions/checkout@v4

# - uses: actions/checkout@v4
#
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
#
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Set up Buildx
# uses: docker/setup-buildx-action@v3
# with:
# buildkitd-flags: --debug
#
# - name: Build and push
# uses: docker/build-push-action@v6
# env:
# DOCKER_BUILD_RECORD_UPLOAD: false
# with:
# context: ./helm
# platforms: linux/amd64,linux/arm64
# push: true
# build-args: |
# CHECKSUM=${{ fromJson(needs.read.outputs.result).checksum.helm }}
# REPO_DIGEST=${{ fromJson(needs.read.outputs.result).digest.helm }}
# VERSION=${{ matrix.version }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
# tags: |
# ghcr.io/boxboat/helm:${{ matrix.version }}
#
# - name: Install regctl
# if: ${{ fromJson(needs.read.outputs.result).latest.helm == matrix.version }}
# uses: iarekylew00t/regctl-installer@v3
#
# - name: Tag latest
# if: ${{ fromJson(needs.read.outputs.result).latest.helm == matrix.version }}
# run: |
# regctl image copy ghcr.io/boxboat/helm:${{ matrix.version }} ghcr.io/boxboat/helm:latest
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

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

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

- name: Set up Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug

- name: Build and push
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: ./${{ matrix.image.command }}
platforms: linux/amd64,linux/arm64
push: true
build-args: |
CHECKSUM=${{ matrix.image.checksum }}
REPO_DIGEST=${{ matrix.image.digest }}
VERSION=${{ matrix.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/boxboat/${{ matrix.image.command }}:${{ matrix.version }}
- name: Install regctl
if: ${{ matrix.image.version == matrix.image.latest }}
uses: iarekylew00t/regctl-installer@v3

- name: Tag latest
if: ${{ matrix.image.version == matrix.image.latest }}
run: |
regctl image copy ghcr.io/boxboat/${{ matrix.image.command }}:${{ matrix.version }} ghcr.io/boxboat/${{ matrix.image.command }}:latest
# helm:
# strategy:
Expand Down

0 comments on commit 555112b

Please sign in to comment.