Compare commits
9 Commits
4b9f6e0695
...
feature/br
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf4036603 | ||
|
|
a0b9e5b692 | ||
|
|
0938ce1270 | ||
|
|
2c78aeeddd | ||
|
|
c56f1f701f | ||
|
|
0b523e75fd | ||
|
|
14170e3261 | ||
|
|
32b391d15d | ||
| 74b6092838 |
36
.gitea/actions/build/action.yml
Normal file
36
.gitea/actions/build/action.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Build docker image
|
||||
description: 'builds docker image'
|
||||
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Docker image tag'
|
||||
required: true
|
||||
|
||||
outputs:
|
||||
image_url:
|
||||
description: 'Full image URL that was built'
|
||||
value: ${{ steps.build.outputs.image_url }}
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Set up Docker Build
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.INSTANCE_URL }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ vars.INSTANCE_URL }}/tech-reborn/phoenix:${{ inputs.tag }}
|
||||
|
||||
- name: Set output
|
||||
shell: bash
|
||||
run: |
|
||||
echo "image_url=${{ vars.INSTANCE_URL }}/tech-reborn/phoenix:${{ inputs.tag }}" >> $GITHUB_OUTPUT
|
||||
@@ -1,35 +0,0 @@
|
||||
name: Build docker image
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Docker image tag'
|
||||
required: true
|
||||
|
||||
outputs:
|
||||
image_url:
|
||||
description: 'Full image URL that was built'
|
||||
value: ${{ steps.build.outputs.image_url }}
|
||||
|
||||
jobs:
|
||||
build_docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Docker Build
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.INSTANCE_URL }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ vars.INSTANCE_URL }}/tech-reborn/phoenix:${{ inputs.tag }}
|
||||
|
||||
- name: Set output
|
||||
shell: bash
|
||||
run: |
|
||||
echo "image_url=${{ vars.INSTANCE_URL }}/tech-reborn/phoenix:${{ inputs.tag }}" >> $GITHUB_OUTPUT
|
||||
@@ -1,20 +0,0 @@
|
||||
name: Build docker image
|
||||
|
||||
outputs:
|
||||
branch_name:
|
||||
description: 'Branch name that can be used as docker image tag'
|
||||
value: ${{ steps.build.outputs.branch_name }}
|
||||
|
||||
jobs:
|
||||
build_docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create tag name
|
||||
run: |
|
||||
BRANCH_NAME="${{ github.ref }}"
|
||||
CLEAN_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
- name: Set output
|
||||
shell: bash
|
||||
run: |
|
||||
echo "branch_name=$CLEAN_BRANCH" >> $GITHUB_OUTPUT
|
||||
23
.gitea/actions/getTagSafeRef/action.yml
Normal file
23
.gitea/actions/getTagSafeRef/action.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
name: 'Get Tag Safe Branch Name'
|
||||
description: 'Get a sanitized branch name that can be used as a Docker tag'
|
||||
|
||||
outputs:
|
||||
branch_name:
|
||||
description: 'Branch name that can be used as docker image tag'
|
||||
value: ${{ steps.get-branch.outputs.branch_name }}
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Create tag safe branch name
|
||||
id: get-branch
|
||||
shell: bash
|
||||
run: |
|
||||
BRANCH_NAME="${{ github.ref }}"
|
||||
|
||||
# Clean the branch name for Docker tag compatibility
|
||||
CLEAN_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
echo "Original branch: $BRANCH_NAME"
|
||||
echo "Clean branch: $CLEAN_BRANCH"
|
||||
echo "branch_name=$CLEAN_BRANCH" >> $GITHUB_OUTPUT
|
||||
@@ -2,22 +2,18 @@ name: ChatOps Deploy
|
||||
on: issue_comment
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
# if: |
|
||||
# github.event.issue.pull_request &&
|
||||
# startsWith(github.event.comment.body, '/deploy') &&
|
||||
# (github.event.comment.author_association == 'OWNER' ||
|
||||
# github.event.comment.author_association == 'MEMBER')
|
||||
testing:
|
||||
if: |
|
||||
gitea.event.issue.pull_request &&
|
||||
startsWith(gitea.event.comment.body, '/deploy')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: say hello
|
||||
# if: contains(github.event.comment.body, '/deploy') # check the comment if it contains the keywords
|
||||
run: |
|
||||
echo say hello
|
||||
- name: Get tag safe branch name
|
||||
id: branch_name
|
||||
uses: ./.gitea/actions/getTagSafeRef
|
||||
|
||||
# - name: Get tag safe branch name
|
||||
# id: branch_name
|
||||
# uses: ./.github/actions/getTagSafeRef
|
||||
- name: Print branch_name
|
||||
run: echo "${{ steps.branch_name.outputs.branch_name }}"
|
||||
|
||||
# - name: Build and push image
|
||||
# id: docker_build
|
||||
|
||||
Reference in New Issue
Block a user