chore: Document that Gap is not to be used on Grid #443
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://evilmartians.com/chronicles/super-github-pages-budget-frontend-staging-with-storybook-and-more | |
name: Feature branch cleanup | |
on: | |
pull_request: | |
types: [closed] | |
branches-ignore: [main] | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
remove_stale_pages: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- name: Create branch name without text before first forward slash | |
run: | | |
RAW_BRANCH_NAME=${{ github.head_ref || github.ref_name }} | |
BRANCH_NAME=$(echo $RAW_BRANCH_NAME | sed 's/[^/]*\///') | |
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Delete folder | |
run: | | |
git config --global user.name GitHub Action | |
git config --global user.email [email protected] | |
git rm demo-${{ env.BRANCH_NAME }} -r | |
git add . | |
git commit -m "Remove feature branch folder" | |
git push | |
- name: Deactivate deployment | |
uses: bobheadxi/deployments@v1 | |
if: always() | |
with: | |
step: deactivate-env | |
token: ${{ secrets.GITHUB_TOKEN }} | |
env: demo-${{ env.BRANCH_NAME }} |