fix: update workflow
This commit is contained in:
@@ -1,41 +1,33 @@
|
||||
|
||||
# Save this file in your repository at: .gitea/workflows/build-docker.yml
|
||||
name: Build and Push Docker Image
|
||||
# .gitea/workflows/build-docker.yml
|
||||
name: Build and Push Docker Image to Gitea Registry
|
||||
|
||||
# This workflow runs on any push to the main branch
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
# This job will run on any runner with the 'docker' label
|
||||
build-and-push-to-gitea:
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
# 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
|
||||
- name: Log in to Gitea Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
# Use secrets for your credentials
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
# 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
|
||||
# This action builds the Dockerfile and pushes it to the registry
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile # Assumes your Dockerfile is in the root of the repo
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
# Update with your desired image name and tag
|
||||
tags: twk95/11ty-site:latest, twk95/11ty-site:${{ github.sha }}
|
||||
|
||||
# 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 }}
|
||||
|
Reference in New Issue
Block a user