50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
name: build-os
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- testing
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
IMAGE: gitea.nekonetwork.io/cybrneko/neko-system
|
|
REGISTRY: gitea.nekonetwork.io
|
|
|
|
jobs:
|
|
build-image:
|
|
runs-on: podman-host
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set tag based on branch
|
|
id: tag
|
|
run: |
|
|
if [ "${GITHUB_REF_NAME}" = "main" ]; then
|
|
echo "tag=latest" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "tag=testing" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Verify tools
|
|
run: |
|
|
podman --version
|
|
sudo -n podman --version
|
|
|
|
- name: Log in to registry
|
|
env:
|
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
|
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }}
|
|
run: |
|
|
echo "$REGISTRY_PASS" | sudo -n podman login "$REGISTRY" \
|
|
-u "$REGISTRY_USER" --password-stdin
|
|
|
|
- name: Build image
|
|
run: |
|
|
sudo -n podman build -f Containerfile -t "$IMAGE:${{ steps.tag.outputs.tag }}" .
|
|
|
|
- name: Push image
|
|
run: |
|
|
sudo -n podman push "$IMAGE:${{ steps.tag.outputs.tag }}"
|