Compare commits
7 Commits
v0.9.5
...
610ec061ca
| Author | SHA1 | Date | |
|---|---|---|---|
| 610ec061ca | |||
| f0570c2cb1 | |||
| 35376b1a5a | |||
| fb238e5bd6 | |||
| b4ddc6708e | |||
| f3965959bc | |||
| e97b778cb7 |
58
.gitea/workflows/build-container.yml
Normal file
58
.gitea/workflows/build-container.yml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Gitea Actions workflow for StarPunk
|
||||||
|
# Builds and pushes container images on version tags
|
||||||
|
|
||||||
|
name: Build Container
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Trigger on version tags
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
# Allow manual trigger from Gitea UI
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
if command -v apk > /dev/null; then
|
||||||
|
apk add --no-cache nodejs npm docker git
|
||||||
|
elif command -v apt-get > /dev/null; then
|
||||||
|
apt-get update && apt-get install -y nodejs npm docker.io git
|
||||||
|
elif command -v yum > /dev/null; then
|
||||||
|
yum install -y nodejs npm docker git
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Extract registry URL
|
||||||
|
id: registry
|
||||||
|
run: |
|
||||||
|
# Extract hostname from server URL (remove protocol)
|
||||||
|
REGISTRY_URL=$(echo "${{ github.server_url }}" | sed 's|https://||' | sed 's|http://||')
|
||||||
|
echo "url=${REGISTRY_URL}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ steps.registry.outputs.url }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Containerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ steps.registry.outputs.url }}/${{ github.repository }}:${{ github.ref_name }}
|
||||||
|
${{ steps.registry.outputs.url }}/${{ github.repository }}:latest
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
Reference in New Issue
Block a user