Update .github/workflows/build.yaml
Some checks failed
Build and Push Docker Image to Gitea Registry / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image to Gitea Registry / build-and-push (push) Has been cancelled
This commit is contained in:
parent
032e35256a
commit
4825294868
26
.github/workflows/build.yaml
vendored
26
.github/workflows/build.yaml
vendored
@ -1,16 +1,16 @@
|
||||
name: Build Docker Image
|
||||
name: Build and Push Docker Image to Gitea Registry
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths_ignore:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@ -34,31 +34,31 @@ jobs:
|
||||
- name: Setup Docker Buildx
|
||||
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
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
# Updated image name to reflect your Gitea registry
|
||||
# Full image name including Gitea Registry URL
|
||||
images: git.d4m13n.dev/damien/personal-website
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
|
||||
- name: Build Docker image (no push)
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
push: false # Enable push to registry
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user