0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-14 16:51:18 -05:00
penpot/.github/workflows/cleanup.yaml
2024-06-20 00:40:10 +02:00

45 lines
No EOL
1.5 KiB
YAML

name: Cleanup branches
on:
delete:
branches:
- "*"
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Determine the branch name
id: determine_branch
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "branch_name=${{ github.head_ref }}" >> $GITHUB_ENV
else
echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
fi
- name: Replace / with - in branch name
id: replace_slash
run: |
SANITIZED_BRANCH_NAME=$(echo "${{ env.branch_name }}" | tr '/' '-')
echo "sanitized_branch_name=${SANITIZED_BRANCH_NAME}" >> $GITHUB_ENV
- name: 🍍 Deploy with Gimlet
uses: gimlet-io/gimlet-artifact-shipper-action@v0.8.3
env:
GIMLET_SERVER: ${{ secrets.GIMLET_SERVER }}
GIMLET_TOKEN: ${{ secrets.GIMLET_TOKEN }}
- name: Delete image
uses: bots-house/ghcr-delete-image-action@v1.1.0
with:
owner: tokens-studio
name: tokens-studio-for-penpot
token: ${{ secrets.PAT_TOKEN }}
tag: pr-frontend-${{ env.sanitized_branch_name }}
- name: Delete image
uses: bots-house/ghcr-delete-image-action@v1.1.0
with:
owner: tokens-studio
name: tokens-studio-for-penpot
token: ${{ secrets.PAT_TOKEN }}
tag: pr-backend-${{ env.sanitized_branch_name }}