Update .github/workflows/release.yaml
Some checks failed
Build and Push Docker Image to Gitea Registry / build-and-push (push) Failing after 7m30s
Some checks failed
Build and Push Docker Image to Gitea Registry / build-and-push (push) Failing after 7m30s
This commit is contained in:
parent
4825294868
commit
76492ad7cb
46
.github/workflows/release.yaml
vendored
46
.github/workflows/release.yaml
vendored
@ -1,20 +1,17 @@
|
|||||||
name: Build and Push Docker Image
|
name: Build and Push Docker Image to Gitea Registry
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Version to tag the image with (e.g., 1.0.0)'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: write # Allows tagging and releasing
|
|
||||||
packages: write
|
|
||||||
pull-requests: write # Allows reading PR info if needed
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@ -37,38 +34,31 @@ jobs:
|
|||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Log in to Container Registry
|
- name: Login to Gitea Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ github.server_url }}/${{ github.repository }}/packages
|
registry: git.d4m13n.dev
|
||||||
username: ${{ github.actor }}
|
username: ${{ secrets.GITEA_REGISTRY_USER }} # Store your Gitea registry username as a secret
|
||||||
password: ${{ secrets.PACKAGE_TOKEN }}
|
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:
|
||||||
images: ${{ github.server_url }}/${{ github.repository }}/personal-website
|
# Full image name including Gitea Registry URL
|
||||||
|
images: git.d4m13n.dev/damien/personal-website
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ github.event.inputs.version }}
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=sha
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true # Enable push to registry
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
${{ github.server_url }}/${{ github.repository }}/personal-website:latest
|
|
||||||
${{ github.server_url }}/${{ github.repository }}/personal-website:${{ github.event.inputs.version }}
|
|
||||||
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
|
||||||
|
|
||||||
- name: Create GitHub Release
|
|
||||||
uses: mathieudutour/github-tag-action@v6.1
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
custom_tag: ${{ github.event.inputs.version }}
|
|
||||||
release_branches: main
|
|
||||||
create_annotated_tag: true
|
|
||||||
tag_prefix: v
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user