clean CI
This commit is contained in:
23
.github/workflows/merge.yml
vendored
Normal file
23
.github/workflows/merge.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Delete Merged Branches
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
delete-branch:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
container:
|
||||||
|
volumes:
|
||||||
|
- /var/docker-web:/var/docker-web
|
||||||
|
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Delete merged branch
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME="${{ github.event.pull_request.head.ref || github.event.inputs.branch_name }}"
|
||||||
|
APP_NAME="${BRANCH_NAME}_${GITHUB_REPOSITORY##*/}"
|
||||||
|
if [ "$BRANCH_NAME" != "main" ] && [ "$BRANCH_NAME" != "develop" ] && [ -n "$APP_NAME" ]; then
|
||||||
|
bash /var/docker-web/src/cli.sh rm -y "${APP_NAME}"
|
||||||
|
else
|
||||||
|
echo "Cannot delete protected branch: $BRANCH_NAME"
|
||||||
|
fi
|
||||||
@@ -14,6 +14,7 @@ jobs:
|
|||||||
bash ./.github/workflows/setup-env.sh
|
bash ./.github/workflows/setup-env.sh
|
||||||
set -a && source .env && set +a
|
set -a && source .env && set +a
|
||||||
if [ -n "$APP_NAME" ]; then
|
if [ -n "$APP_NAME" ]; then
|
||||||
|
set -a && source .env && set +a
|
||||||
bash /var/docker-web/src/cli.sh down "${APP_NAME}"
|
bash /var/docker-web/src/cli.sh down "${APP_NAME}"
|
||||||
rm -rf "$APP_DIR"
|
rm -rf "$APP_DIR"
|
||||||
mkdir "$APP_DIR"
|
mkdir "$APP_DIR"
|
||||||
0
.github/workflows/setup-env.sh
vendored
Executable file → Normal file
0
.github/workflows/setup-env.sh
vendored
Executable file → Normal file
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
here is the New front
|
here is the New New front
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user