Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30d0485da3 | ||
|
|
3232abab68 | ||
|
|
6add9f7cad | ||
|
|
e8ca15df06 | ||
|
|
1061864cae | ||
|
|
26449dd5c9 | ||
|
|
72e822950b | ||
|
|
d3396a4c9b | ||
|
|
1269b35dbd | ||
|
|
0163625507 | ||
|
|
b28c1e6795 |
46
.gitea/workflows/build_container.yml
Normal file
46
.gitea/workflows/build_container.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*' # Trigger on any git tag
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Podman
|
||||||
|
run: |
|
||||||
|
export XDG_RUNTIME_DIR=/tmp/run-user
|
||||||
|
export HOME=/tmp/home
|
||||||
|
mkdir -p $XDG_RUNTIME_DIR $HOME
|
||||||
|
# Ensure Podman is installed
|
||||||
|
if ! command -v podman &> /dev/null; then
|
||||||
|
echo "Podman not found, installing..."
|
||||||
|
sudo apt-get update && sudo apt-get install -y podman
|
||||||
|
fi
|
||||||
|
podman info || true # info will fail if storage driver is overlay, ignore
|
||||||
|
|
||||||
|
|
||||||
|
- name: Log in to Docker registry
|
||||||
|
run: |
|
||||||
|
echo "${REGISTRY_PASSWORD}" | podman login ${GITEA_REGISTRY} \
|
||||||
|
--username ${REGISTRY_USERNAME} --password-stdin
|
||||||
|
env:
|
||||||
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
run: |
|
||||||
|
IMAGE_TAG="Papryk/dj-spangebob:${{ gitea.ref_name }}"
|
||||||
|
echo "Building image $IMAGE_TAG"
|
||||||
|
podman build -t "$IMAGE_TAG" .
|
||||||
|
echo "Pushing image $IMAGE_TAG"
|
||||||
|
podman push "$IMAGE_TAG"
|
||||||
|
env:
|
||||||
|
TAG: ${{ gitea.ref_name }}
|
||||||
|
|
||||||
Reference in New Issue
Block a user