Skip to content

Commit 2058b7a

Browse files
committed
Update github action to display git branch
1 parent 994c109 commit 2058b7a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Deploy to Cloudflare Page Static Site
22

33
on:
4-
# Trigger the workflow every time you push to the `main` branch
4+
# Trigger the workflow every time you push to the `main` or `staging` branch
55
# Using a different branch name? Replace `main` with your branch’s name
66
push:
7-
branches: [main]
7+
branches: [main, staging]
88
# Allows you to run this workflow manually from the Actions tab on GitHub.
99
workflow_dispatch:
1010

@@ -24,8 +24,20 @@ jobs:
2424
build:
2525
runs-on: ubuntu-latest
2626
steps:
27+
28+
- name: Extract branch name
29+
shell: bash
30+
run: echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
31+
id: extract_branch
32+
33+
- name: Display git branch
34+
shell: bash
35+
run: echo ${{ env.GIT_BRANCH }}
36+
2737
- name: Checkout your repository using git
2838
uses: actions/checkout@v4
39+
with:
40+
ref: ${{ env.STORE_PATH }}
2941

3042
- name: Use Node.js 20
3143
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)