From 547b232669d118aa19ed6cfc1cd2f6aea35eef60 Mon Sep 17 00:00:00 2001 From: Kevin Sivic Date: Sun, 30 Nov 2025 21:01:54 -0500 Subject: [PATCH] Simplify Forgejo Actions workflow for compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove GitHub Actions marketplace actions (uses directive) - Use shell commands instead for better compatibility - Switch from gitea context to github context variables - Use Docker container to run build commands Fixes YAML schema validation errors in Forgejo runner 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .forgejo/workflows/docker-build.yml | 56 +++++++++-------------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/.forgejo/workflows/docker-build.yml b/.forgejo/workflows/docker-build.yml index 25a464f..de392db 100644 --- a/.forgejo/workflows/docker-build.yml +++ b/.forgejo/workflows/docker-build.yml @@ -4,54 +4,30 @@ on: push: branches: - main - pull_request: - branches: - - main - -env: - REGISTRY: forgejo.sivic.me - IMAGE_NAME: ${{ gitea.repository }} jobs: build-and-push: runs-on: ubuntu-latest - permissions: - contents: read - packages: write + container: + image: docker:latest steps: - name: Checkout repository - uses: actions/checkout@v4 + run: | + apk add --no-cache git + git clone ${{ github.server_url }}/${{ github.repository }} . + git checkout ${{ github.sha }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Build Docker image + run: | + docker build -t forgejo.sivic.me/${{ github.repository }}:latest \ + -t forgejo.sivic.me/${{ github.repository }}:${{ github.sha }} . - name: Log in to Forgejo Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ gitea.actor }} - password: ${{ secrets.GITEA_TOKEN }} + run: | + echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=sha,prefix={{branch}}- - type=raw,value=latest,enable={{is_default_branch}} - - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max + - name: Push Docker image + run: | + docker push forgejo.sivic.me/${{ github.repository }}:latest + docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}