Update .github/workflows/build.yaml
Some checks failed
Build and Push Docker Image to Gitea Registry / build-and-push (push) Has been cancelled

This commit is contained in:
damien 2025-02-27 04:28:21 +00:00
parent 032e35256a
commit 4825294868

View File

@ -1,16 +1,16 @@
name: Build Docker Image name: Build and Push Docker Image to Gitea Registry
on: on:
push: push:
branches: [ main ] branches: [ main ]
paths_ignore: paths-ignore:
- '**.md' - '**.md'
pull_request: pull_request:
branches: [ main ] branches: [ main ]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: build-and-push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -34,31 +34,31 @@ jobs:
- name: Setup Docker Buildx - name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Login to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: git.d4m13n.dev
username: ${{ secrets.GITEA_REGISTRY_USER }} # Store your Gitea registry username as a secret
password: ${{ secrets.GITEA_REGISTRY_TOKEN }} # Store your Gitea registry token/password as a secret
- name: Extract metadata for Docker - name: Extract metadata for Docker
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
# Updated image name to reflect your Gitea registry # Full image name including Gitea Registry URL
images: git.d4m13n.dev/damien/personal-website images: git.d4m13n.dev/damien/personal-website
tags: | tags: |
type=ref,event=branch type=ref,event=branch
type=ref,event=pr type=ref,event=pr
type=sha type=sha
- name: Build Docker image (no push) - name: Build and push Docker image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:
context: . context: .
push: false push: false # Enable push to registry
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/image.tar
- name: Save Docker image as artifact
uses: actions/upload-artifact@v3
with:
name: docker-image
path: /tmp/image.tar
retention-days: 1