Skip to content

Commit

Permalink
ci-wip: arm runner, skiip docker cleanup, bootstrap package maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga authored Jan 25, 2025
1 parent b898fd1 commit 8401808
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/__package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
docker:
name: Docker image for ${{ matrix.platform }} 💿🐳
runs-on: ubuntu-latest
runs-on: ${{ contains(matrix.platform, 'arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
needs: docker_inputs
strategy:
fail-fast: false
Expand All @@ -189,6 +189,9 @@ jobs:

- name: Configure Docker Buildx ⚙️
uses: docker/setup-buildx-action@v3.8.0
with:
cleanup: false
version: latest

- name: Build images 🛠️
uses: docker/build-push-action@v6.13.0
Expand All @@ -197,11 +200,9 @@ jobs:
context: .
file: packaging/docker/Dockerfile
platforms: ${{ format('linux/{0}', matrix.platform) }}
cache-from: |
type=gha,scope=buildx-${{ matrix.platform }}
no-cache: true
cache-to: |
type=local,mode=min,dest=/tmp/${{ env.REGISTRY_IMAGE }}/cache/${{ matrix.platform }}
type=gha,mode=min,ignore-error=true,scope=buildx-${{ matrix.platform }}
outputs: type=docker,dest=docker_image.tar
build-args: |
${{ inputs.commit == '' && 'IS_STABLE=1' || '' }}
Expand Down Expand Up @@ -295,6 +296,9 @@ jobs:

- name: Configure Docker Buildx ⚙️
uses: docker/setup-buildx-action@v3.8.0
with:
cleanup: false
version: latest

- name: Login to Docker Hub 🔑
uses: docker/login-action@v3.3.0
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,49 @@ jobs:
security-events: write
with:
commit: ${{ github.sha }}

container_retention:
name: Package maintenance 👷‍♂️
runs-on: ubuntu-latest
env:
REGISTRY_IMAGE: jellyfin/jellyfin-vue
steps:
- name: Login to GitHub Container Registry 🔑
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.JF_BOT_TOKEN }}

- name: Login to Docker Hub 🔑
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Fetch multi-platform package version SHAs
id: multi-arch-digests
run: |
package=$(docker manifest inspect "$REGISTRY_IMAGE" | jq -r '.manifests.[] | .digest' | paste -s -d ' ' -)
echo "value=$package" >> $GITHUB_OUTPUT
- name: Test
run: echo ${{ steps.multi-arch-digests.outputs.value }}

- name: Remove old container versions 🗑️
uses: snok/container-retention-policy@v3.0.0
with:
account: snok
token: ${{ secrets.JF_BOT_TOKEN }}
image-names: ${{ env.REGISTRY_IMAGE }}
image-tags: unstable*
tag-selection: both
cut-off: 4w # 4 weeks
skip-shas: ${{ steps.multi-arch-digests.outputs.value }}
dry-run: true

# Waiting for https://github.com/containers/skopeo/issues/2503
# - name: Sync GHCR with DockerHub 🔄
# run: |
# sudo apt -y install skopeo
# skopeo sync -a --preserve-digests -s docker://ghcr.io/"$REGISTRY_IMAGE" -d docker://docker.io/"$REGISTRY_IMAGE"

0 comments on commit 8401808

Please sign in to comment.