Public Access
1
0

fix: update workflow

This commit is contained in:
2025-09-02 00:49:56 -04:00
parent 54f6392f56
commit 590f9ccbbf

View File

@@ -1,41 +1,33 @@
# .gitea/workflows/build-docker.yml
name: Build and Push Docker Image to Gitea Registry
# Save this file in your repository at: .gitea/workflows/build-docker.yml
name: Build and Push Docker Image
# This workflow runs on any push to the main branch
on: on:
push: push:
branches: branches:
- main - main
jobs: jobs:
build-and-push: build-and-push-to-gitea:
# This job will run on any runner with the 'docker' label
runs-on: docker runs-on: docker
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Log in to Gitea Registry
# This action sets up a builder instance required for build-push-action
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
# This action logs into your container registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
# Use secrets for your credentials # This will now automatically resolve to "git.twk95.net"
username: ${{ secrets.DOCKER_USERNAME }} registry: ${{ gitea.server_url }}
password: ${{ secrets.DOCKER_PASSWORD }} username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Build and push Docker image - name: Build and push Docker image
# This action builds the Dockerfile and pushes it to the registry
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: ./Dockerfile # Assumes your Dockerfile is in the root of the repo file: ./Dockerfile
push: true push: true
# Update with your desired image name and tag # The tag will now correctly be:
tags: twk95/11ty-site:latest, twk95/11ty-site:${{ github.sha }} # git.twk95.net/twk95/11ty-site:latest
tags: ${{ gitea.server_url }}/${{ gitea.repository }}:latest, ${{ gitea.server_url }}/${{ gitea.repository }}:${{ gitea.sha }}