feat: set-image-name

This commit is contained in:
Leandro Costa 2025-06-21 18:12:46 -03:00
parent 4a01570b5f
commit 5be8bcf5fe
3 changed files with 17 additions and 59 deletions

View file

@ -0,0 +1,17 @@
name: Forgejo Set Image Name
description: Define IMAGE_NAME to Git Hub env, based on repository name
runs:
using: composite
steps:
- name: Set Image Name
shell: sh
run: |
export REPO_FULL=${{ github.repository }}
export REPO_NAME=${REPO_FULL#*/}
if [ "${{ github.ref_name }}" != "master" ]; then
export IMAGE_NAME=${{ secrets.DOCKER_HUB_USERNAME }}/$REPO_NAME-dev
else
export IMAGE_NAME=${{ secrets.DOCKER_HUB_USERNAME }}/$REPO_NAME
fi
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV

View file

@ -1,36 +0,0 @@
name: Reusable Mirror Workflow
on:
workflow_call:
inputs:
remote_url:
required: true
type: string
force:
required: false
type: boolean
default: false
jobs:
push:
runs-on: docker
container:
image: node:20-alpine
steps:
- name: Instalando dependencias
run: |
apk add git
- name: Checkout código
uses: actions/checkout@v4
with:
fetch-depth: 0 # ✅ clone completo
- name: Push branch atual
run: |
git remote add mirror ${{ inputs.remote_url }}
if [ "${{ inputs.force }}" = "true" ]; then
git push --force mirror HEAD
else
git push mirror HEAD
fi

View file

@ -1,23 +0,0 @@
name: Test SSH Workflow
on:
push:
branches:
- main
- development
workflow_dispatch:
jobs:
exec-command:
runs-on: docker
container:
image: ubuntu:latest
steps:
- name: Instalando dependências
run: |
apt update
apt install -y openssh-client
- name: Comando remoto via SSH
run: |
ls -lha ~/.ssh
ssh -o StrictHostKeyChecking=no root@172.233.17.72 -t 'w'