ci: push temp tags and create multi-arch from them and cleanup
This commit is contained in:
53
.github/workflows/ci.yml
vendored
53
.github/workflows/ci.yml
vendored
@@ -65,30 +65,39 @@ jobs:
|
|||||||
- runner: ubuntu-24.04-arm
|
- runner: ubuntu-24.04-arm
|
||||||
platform: linux/arm64
|
platform: linux/arm64
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
outputs:
|
|
||||||
image-amd64: ${{ steps.meta.outputs.image-amd64 }}
|
|
||||||
image-arm64: ${{ steps.meta.outputs.image-arm64 }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Generate image metadata
|
- name: Log in to Docker Hub
|
||||||
id: meta
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Set lower case owner name
|
||||||
run: |
|
run: |
|
||||||
echo "image-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}=localhost/jellyseerr:develop-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}" >> $GITHUB_OUTPUT
|
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
|
||||||
- name: Build platform image
|
env:
|
||||||
|
OWNER: ${{ github.repository_owner }}
|
||||||
|
- name: Build and push temp platform image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
# dont push until merged
|
push: true
|
||||||
push: false
|
|
||||||
load: true
|
|
||||||
build-args: |
|
build-args: |
|
||||||
COMMIT_TAG=${{ github.sha }}
|
COMMIT_TAG=${{ github.sha }}
|
||||||
tags: ${{ steps.meta.outputs[format('image-{0}', matrix.platform == 'linux/amd64' && 'amd64' || 'arm64')] }}
|
tags: |
|
||||||
|
fallenbagel/jellyseerr:temp-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
|
||||||
|
ghcr.io/${{ env.OWNER_LC }}/jellyseerr:temp-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
|
||||||
cache-from: type=gha,scope=${{ matrix.platform }}
|
cache-from: type=gha,scope=${{ matrix.platform }}
|
||||||
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
|
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
|
||||||
provenance: false
|
provenance: false
|
||||||
@@ -114,21 +123,25 @@ jobs:
|
|||||||
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
|
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
|
||||||
env:
|
env:
|
||||||
OWNER: ${{ github.repository_owner }}
|
OWNER: ${{ github.repository_owner }}
|
||||||
- name: Create and push Docker Hub manifest
|
- name: Create and push manifest
|
||||||
run: |
|
run: |
|
||||||
docker manifest create fallenbagel/jellyseerr:develop \
|
docker manifest create fallenbagel/jellyseerr:develop \
|
||||||
${{ needs.build.outputs.image-amd64 }} \
|
fallenbagel/jellyseerr:temp-amd64 \
|
||||||
${{ needs.build.outputs.image-arm64 }}
|
fallenbagel/jellyseerr:temp-arm64
|
||||||
|
|
||||||
docker manifest push fallenbagel/jellyseerr:develop
|
docker manifest push fallenbagel/jellyseerr:develop
|
||||||
- name: Create and push GHCR manifest
|
|
||||||
run: |
|
|
||||||
docker manifest create ghcr.io/${{ env.OWNER_LC }}/jellyseerr:develop \
|
|
||||||
${{ needs.build.outputs.image-amd64 }} \
|
|
||||||
${{ needs.build.outputs.image-arm64 }}
|
|
||||||
|
|
||||||
|
# GHCR manifest
|
||||||
|
docker manifest create ghcr.io/${{ env.OWNER_LC }}/jellyseerr:develop \
|
||||||
|
ghcr.io/${{ env.OWNER_LC }}/jellyseerr:temp-amd64 \
|
||||||
|
ghcr.io/${{ env.OWNER_LC }}/jellyseerr:temp-arm64
|
||||||
docker manifest push ghcr.io/${{ env.OWNER_LC }}/jellyseerr:develop
|
docker manifest push ghcr.io/${{ env.OWNER_LC }}/jellyseerr:develop
|
||||||
|
|
||||||
|
# Cleanup temporary tags
|
||||||
|
docker manifest rm fallenbagel/jellyseerr:temp-amd64
|
||||||
|
docker manifest rm fallenbagel/jellyseerr:temp-arm64
|
||||||
|
docker manifest rm ghcr.io/${{ env.OWNER_LC }}/jellyseerr:temp-amd64
|
||||||
|
docker manifest rm ghcr.io/${{ env.OWNER_LC }}/jellyseerr:temp-arm64
|
||||||
|
|
||||||
discord:
|
discord:
|
||||||
name: Send Discord Notification
|
name: Send Discord Notification
|
||||||
needs: merge_and_push
|
needs: merge_and_push
|
||||||
|
|||||||
Reference in New Issue
Block a user