Skip to content

Commit

Permalink
adjust to dynamically commit PR builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ksentak committed May 13, 2024
1 parent 1ebecd8 commit f5efc29
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build and Deploy FCA

on:
pull_request:
branches:
- dev
push:
branches:
- dev
Expand Down Expand Up @@ -32,16 +35,17 @@ jobs:
- name: Dynamically move build files to the correct directory
run: |
BRANCH_NAME=$(echo ${{ github.ref }} | sed -n 's/refs\/heads\///p')
if [[ "$BRANCH_NAME" == "main" ]]; then
mkdir -p prod
mv dist/web/* prod/
elif [[ "$BRANCH_NAME" == "dev" ]]; then
mkdir -p edge
mv dist/web/* edge/
elif [[ "$BRANCH_NAME" == "feature/deploy-fca-with-actions" ]]; then
mkdir -p feature
mv dist/web/* feature/
if [[ "${{github.event_name}}" == "pull_request" ]]; then
PR_NUMBER=${{ github.event.pull_request.number }}
mkdir -p PR-$PR_NUMBER
mv dist/web/* PR-$PR_NUMBER/
else
BRANCH_NAME=$(echo ${{ github.ref }} | sed -n 's/refs\/heads\///p')
if [[ "$BRANCH_NAME"]] == "main" ]]; then
mv dist/web/* prod/
elif [[ "$BRANCH_NAME" == "dev" ]]; then
mv dist/web/* edge/
fi
fi
- name: Create commit
Expand All @@ -55,6 +59,9 @@ jobs:
git add edge/
elif [[ "$BRANCH_NAME" == "feature/deploy-fca-with-actions" ]]; then
git add feature/
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
PR_NUMBER=${{ github.event.pull_request.number }}
git add PR-$PR_NUMBER
fi
git commit -m "Add bundled code"
Expand Down

0 comments on commit f5efc29

Please sign in to comment.