33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
name: Build and Push Podman Container
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: debian13
|
|
steps:
|
|
# actions/checkout is a Node.js based action, but the "debian13" runner
|
|
# has no Node.js installed, which causes:
|
|
# "exec: node: executable file not found in $PATH"
|
|
# Do a plain git checkout instead, which only needs git/bash.
|
|
- name: Checkout code
|
|
run: |
|
|
git init
|
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
|
git fetch --depth 1 origin "${GITHUB_SHA}"
|
|
git checkout --force FETCH_HEAD
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
run: |
|
|
echo "${{ secrets.GITHUB_TOKEN }}" | podman login gitea.pkm.physik.tu-darmstadt.de -u ${{ github.actor }} --password-stdin
|
|
|
|
- name: Build and push image
|
|
run: |
|
|
IMAGE_TAG=gitea.pkm.physik.tu-darmstadt.de/${{ github.repository }}:latest
|
|
podman build -t $IMAGE_TAG .
|
|
podman push $IMAGE_TAG
|