feat: set-image-name
This commit is contained in:
parent
4a01570b5f
commit
ec4a5384ab
3 changed files with 19 additions and 59 deletions
19
.forgejo/actions/set-image-name/action.yml
Normal file
19
.forgejo/actions/set-image-name/action.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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=${{ env.DOCKER_HUB_USERNAME }}/$REPO_NAME-dev
|
||||||
|
else
|
||||||
|
export IMAGE_NAME=${{ env.DOCKER_HUB_USERNAME }}/$REPO_NAME
|
||||||
|
fi
|
||||||
|
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
|
||||||
|
env:
|
||||||
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
@ -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
|
|
|
@ -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'
|
|
Loading…
Add table
Add a link
Reference in a new issue