containers/.forgejo/workflows/jupyter.yml-disabled

67 lines
2 KiB
Text
Raw Permalink Normal View History

2025-10-07 13:09:34 +02:00
# Workflow name
2025-10-07 13:11:28 +02:00
name: Build and Push jupyter Container
2025-10-07 13:09:34 +02:00
# Run-name for each workflow run
2025-10-07 13:11:28 +02:00
run-name: Build and Push jupyter Container
2025-10-07 13:09:34 +02:00
on:
push:
branches:
- main
paths:
2025-10-07 13:11:28 +02:00
- 'containers/jupyter/**'
- '.forgejo/workflows/jupyter.yml'
2025-10-07 13:09:34 +02:00
workflow_dispatch: {}
schedule:
- cron: '0 20 * * 5' # Runs every Friday at 8 PM UTC
env:
2025-10-07 13:11:28 +02:00
CONTAINER_NAME: jupyter
2025-10-07 13:09:34 +02:00
# USER: ${{ github.actor }}
USER: hbms
jobs:
build-and-push-arch:
runs-on: ${{ matrix.arch }}
strategy:
matrix:
arch: [ amd64, arm64 ]
container:
image: ghcr.io/catthehacker/ubuntu:act-22.04
steps:
- name: Prepare environment variables
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo REGISTRY=${{ vars.REGISTRY }} >> $GITHUB_ENV
- name: Checkout the repo
uses: actions/checkout@v4
- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ env.USER }}
password: ${{ secrets.PACKAGE_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
2025-10-07 13:11:28 +02:00
context: ./containers/jupyter/
file: ./containers/jupyter/Dockerfile
2025-10-07 13:09:34 +02:00
push: true
provenance: false
tags: ${{ vars.REGISTRY }}/${{ env.USER }}/${{ env.CONTAINER_NAME }}-${{ matrix.arch }}:latest
merge-images-via-manifest:
runs-on: amd64
needs: build-and-push-arch
container:
image: ghcr.io/catthehacker/ubuntu:act-22.04
steps:
- name: Generate and push multi-arch manifest
run: |
echo REGISTRY=${{ vars.REGISTRY }} >> $GITHUB_ENV
echo ${{ secrets.PACKAGE_TOKEN }} | docker login ${{ vars.REGISTRY }} -u ${USER} --password-stdin
docker manifest create ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}:latest ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}-amd64:latest ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}-arm64:latest
docker manifest push ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}:latest