Skip to content

ci: public arm64 docker image #850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 70 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
name: Publish
name: Build and Validate
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
publish:
runs-on: ubuntu-latest
build:
strategy:
matrix:
arch: [amd64, arm64]
include:
- arch: amd64
platform: linux/amd64
runner: ubuntu-latest
- arch: arm64
platform: linux/arm64
runner: arm-hooray
runs-on: ${{ matrix.runner }}
permissions:
contents: read
id-token: write
Expand All @@ -25,27 +38,76 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Set the Docker tags based on the event type
- name: Set Docker tags
id: docker-tags
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HYPERION_PROXY_TAGS=ghcr.io/${{ github.repository }}/hyperion-proxy:pr-${{ github.event.pull_request.number }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
echo "TAG_TAGS=ghcr.io/${{ github.repository }}/tag:pr-${{ github.event.pull_request.number }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
else
echo "HYPERION_PROXY_TAGS=ghcr.io/${{ github.repository }}/hyperion-proxy:latest-${{ matrix.arch }},ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
echo "TAG_TAGS=ghcr.io/${{ github.repository }}/tag:latest-${{ matrix.arch }},ghcr.io/${{ github.repository }}/tag:${{ github.sha }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
fi

- name: Build and push hyperion-proxy
uses: docker/build-push-action@v5
with:
context: .
target: hyperion-proxy
platforms: linux/amd64
platforms: ${{ matrix.platform }}
push: true
tags: |
ghcr.io/${{ github.repository }}/hyperion-proxy:latest
ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.docker-tags.outputs.HYPERION_PROXY_TAGS }}

- name: Build and push tag
uses: docker/build-push-action@v5
with:
context: .
target: tag
platforms: linux/amd64
platforms: ${{ matrix.platform }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.docker-tags.outputs.TAG_TAGS }}

manifest:
needs: build
# Only run manifest job on pushes to main
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push manifest for hyperion-proxy
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository }}/hyperion-proxy:latest
ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }}
outputs: type=image,name=ghcr.io/${{ github.repository }}/hyperion-proxy

- name: Create and push manifest for tag
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository }}/tag:latest
ghcr.io/${{ github.repository }}/tag:${{ github.sha }}
outputs: type=image,name=ghcr.io/${{ github.repository }}/tag

- name: Update test server
env:
Expand Down
Loading