34 lines
949 B
YAML
34 lines
949 B
YAML
# .gitea/workflows/build-docker.yml
|
|
name: Build and Push Docker Image to Gitea Registry
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push-to-gitea:
|
|
runs-on: docker
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
# This will now automatically resolve to "git.twk95.net"
|
|
registry: ${{ gitea.server_url }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
# The tag will now correctly be:
|
|
# git.twk95.net/twk95/11ty-site:latest
|
|
tags: ${{ gitea.server_url }}/${{ gitea.repository }}:latest, ${{ gitea.server_url }}/${{ gitea.repository }}:${{ gitea.sha }}
|