Skip to content

Commit 671685b

Browse files
committed
deploy version from branch push
1 parent 7a377e3 commit 671685b

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: Release squid
2-
1+
name: Release squid version
32
on:
43
push:
5-
tags:
6-
- 'v*'
4+
branches:
5+
- 'v[0-9]+'
76

87
jobs:
98
build_and_publish:
@@ -25,22 +24,22 @@ jobs:
2524

2625
- name: update squid.yml
2726
run: |
28-
# Get the tag from GitHub
29-
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
30-
31-
# Extract the numeric part of the tag
32-
VERSION=$(echo $TAG | sed 's/v//')
33-
27+
# Get the branch name from GitHub
28+
BRANCH_NAME=${{ github.ref_name }}
29+
30+
# Extract the version from the branch name (assuming format 'vXX')
31+
VERSION=$(echo $BRANCH_NAME | sed 's/^v//')
32+
3433
# Update the version in squid.yaml
3534
sed -i "s/^version: .*/version: $VERSION/" squid.yaml
36-
35+
3736
# Optional: Print the updated version for verification
3837
echo "Updated squid.yaml version to: $VERSION"
39-
38+
4039
- name: Authenticate to squid
41-
env:
40+
env:
4241
API_TOKEN: ${{ secrets.SQUID_API_TOKEN }}
4342
run: sqd auth -k $API_TOKEN
4443

4544
- name: Build and deploy squid
46-
run: sqd build && sqd deploy . -o origin --no-stream-logs
45+
run: sqd build && sqd deploy . -o origin --no-stream-logs --allow-update

0 commit comments

Comments
 (0)