Skip to content

Commit

Permalink
Publish 24.04 images to GitHub Container Registry
Browse files Browse the repository at this point in the history
Ref #1
  • Loading branch information
strugee committed Oct 1, 2024
1 parent 322fa13 commit 0ec9610
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build container images

on:
push:
branches:
- main
schedule:
- cron: '20 3 * * 0' # Basically picked at random to try and be a low-load time for GitHub Actions
workflow_dispatch:

jobs:
login:
name: Log in to GitHub Container Registry
runs-on: ubuntu-latest
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
steps:
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
build_push_images:
name: Build and push container images
runs-on: ubuntu-latest
steps:

- name: Checkout Repo
uses: actions/checkout@v1

- name: Build and push container images
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: ./build-and-push.sh 24.04
4 changes: 4 additions & 0 deletions build-and-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

./build.sh $1
podman push ubuntu-server-dev:$1 $(podman images --format='{{.Repository}}:{{.Tag}}' | grep localhost/ubuntu-server-dev | tr '\n' ' ' | sed 's;localhost/;ghcr.io/seagl/ubuntu-server-dev/;g')

0 comments on commit 0ec9610

Please sign in to comment.