feac66dcd0
Remove automated deploy — Portainer handles deployments for now. build.yml: deploy job removed, only builds and pushes image to registry. infra/runner-compose.yml: clean standalone Portainer stack for act_runner, no swarm network dependency, uses external Forgejo URL. infra/runner-swarm.yml: removed (replaced by runner-compose.yml). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
# Runs only on pushes to main.
|
|
# Builds the Docker image and pushes it to the Forgejo container registry.
|
|
# Registry-side layer caching means unchanged layers (npm install, pip install)
|
|
# are reused between builds — typically cuts build time from ~4 min to ~45 sec.
|
|
#
|
|
# The resulting image can then be deployed manually via Portainer.
|
|
#
|
|
# Required secrets (repo → Settings → Secrets → Actions):
|
|
# REGISTRY_USER — your Forgejo username
|
|
# REGISTRY_TOKEN — Forgejo PAT with write:packages scope (create at
|
|
# git.fabledsword.com → Settings → Applications → Generate Token)
|
|
name: Build & push image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
env:
|
|
REGISTRY: git.fabledsword.com
|
|
IMAGE: git.fabledsword.com/bvandeusen/fabledassistant
|
|
|
|
jobs:
|
|
build:
|
|
name: Build & push
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Forgejo registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
${{ env.IMAGE }}:latest
|
|
${{ env.IMAGE }}:${{ github.sha }}
|
|
cache-from: type=registry,ref=${{ env.IMAGE }}:cache
|
|
cache-to: type=registry,ref=${{ env.IMAGE }}:cache,mode=max
|