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:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version to tag the image with (e.g., 1.0.0)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # Allows tagging and releasing
|
||||
packages: write
|
||||
pull-requests: write # Allows reading PR info if needed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@ -37,38 +34,31 @@ jobs:
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to Container Registry
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ github.server_url }}/${{ github.repository }}/packages
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.PACKAGE_TOKEN }}
|
||||
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:
|
||||
images: ${{ github.server_url }}/${{ github.repository }}/personal-website
|
||||
# Full image name including Gitea Registry URL
|
||||
images: git.d4m13n.dev/damien/personal-website
|
||||
tags: |
|
||||
type=raw,value=${{ github.event.inputs.version }}
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ github.server_url }}/${{ github.repository }}/personal-website:latest
|
||||
${{ github.server_url }}/${{ github.repository }}/personal-website:${{ github.event.inputs.version }}
|
||||
push: true # Enable push to registry
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
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