Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Beta Build
name: Build Beta

on:
pull_request:
Expand Down Expand Up @@ -39,14 +39,14 @@ jobs:
mv beta/beta-compile.yml beta/beta-branch.yml .github/workflows/
mv beta/index.html beta/404.html beta/CNAME docs/

- name: Push to Beta
- name: Push Beta
run: |
BRANCH=${{ github.head_ref }}
git config user.name "chiefmikey"
git config user.email "wolfemikl@gmail.com"
git remote set-url --add --push origin https://github.com/chiefmikey/gitlang-beta.git
echo remote-test: $(git remote -v)
git add .
git commit -am 'Beta Files'
git reset $(git commit-tree HEAD^{tree} -m 'Beta Branch')
git push -fu origin HEAD:refs/heads/${BRANCH}
echo "https://beta.gitlang.net"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Production Build
name: Build Production

on:
push:
Expand Down Expand Up @@ -28,7 +28,7 @@ jobs:
npm install
NODE_ENV=production NODE_OPTIONS=--loader=ts-node/esm webpack --mode production

- name: Prune
- name: Prune Files
run : |
prune() {
echo "${1}";
Expand All @@ -45,7 +45,7 @@ jobs:
export -f prune
find . -maxdepth 1 | while read file; do prune ${file}; done

- name: Push
- name: Push Client
run: |
git config user.name "chiefmikey"
git config user.email "wolfemikl@gmail.com"
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/prune-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Prune Beta

on:
pull_request:
types:
- closed

jobs:
prune:
if: github.event.pull_request.merged == true
name: Prune
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: List Merged
run: |
FORMAT="%(if:equals=[gone])%(upstream:track)%(then)%(refname:short)%(end)"
MERGED_BRANCHES=$(git branch --list --format ${FORMAT})

- name: Checkout Beta
uses: actions/checkout@v3
with:
token: ${{ secrets.DISPATCH_REPO }}
repository: chiefmikey/gitlang-beta
fetch-depth: 0

- name: Delete Merged
run: |
BRANCH=${{ github.head_ref }}
BRANCHES=$(git branch --list)
echo test merged: ${MERGED_BRANCHES}
echo test branch: ${BRANCH}
echo test branches: ${BRANCHES}
for branch in $(echo ${BRANCHES}); do
if [ -z "${MERGED_BRANCHES##*${branch}*}" ] || [ -z "${BRANCH##*${branch}*}" ]; then
echo "Delete ${branch}"
git push origin --delete ${branch}
fi
done