ci: add release workflow
This commit is contained in:
parent
2a310f3539
commit
4ec7fc5cf3
1 changed files with 52 additions and 0 deletions
52
.gitea/workflows/release.yaml
Normal file
52
.gitea/workflows/release.yaml
Normal file
|
@ -0,0 +1,52 @@
|
|||
name: Manual Release and Docker Image Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version for the release (e.g., v1.0.0)"
|
||||
required: true
|
||||
default: "v1.0.0"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Create Release and Build Docker Image
|
||||
runs-on: ubuntu-latest-root
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.vavakado.xyz # Replace with your Docker registry URL
|
||||
username: ${{ gitea.actor }} # The actor who triggered the action
|
||||
password: ${{ secrets.REGISTRY_TOKEN }} # Your registry token secret
|
||||
|
||||
- name: Create Git Tag
|
||||
run: |
|
||||
git tag ${{ github.event.inputs.version }}
|
||||
git push origin ${{ github.event.inputs.version }}
|
||||
|
||||
- name: Create Release
|
||||
run: |
|
||||
curl -X POST -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"tag_name": "${{ github.event.inputs.version }}",
|
||||
"target_commitish": "main", # Change if your default branch is different
|
||||
"name": "${{ github.event.inputs.version }}",
|
||||
"body": "Release for version ${{ github.event.inputs.version }}",
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}' \
|
||||
https://git.vavakado.xyz/api/v1/repos/${{ gitea.repository_owner }}/${{ gitea.repository }}/releases
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build -t git.vavakado.xyz/${{ gitea.repository_owner }}/exmr:${{ github.event.inputs.version }} .
|
||||
|
||||
- name: Push Docker Image
|
||||
run: |
|
||||
docker push git.vavakado.xyz/${{ gitea.repository_owner }}/exmr:${{ github.event.inputs.version }}
|
Loading…
Reference in a new issue