-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (36 loc) · 1.11 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Push to PWS
on:
push:
branches: [ main, master ]
paths-ignore:
- '**.md'
pull_request:
branches: [ main, master ]
paths-ignore:
- '**.md'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Check PWS remote, pull, merge, and push
env:
PWS_URL: ${{ secrets.PWS_URL }}
run: |
echo "Creating temporary branch"
git checkout -b tmp
# Push to master branch and capture the output
push_output=$(git push $PWS_URL tmp:master 2>&1)
if [[ $? -ne 0 ]]; then
echo "Push failed with output: $push_output"
echo "Error: Unable to push changes. Please check the error message above and resolve any conflicts manually."
exit 1
fi
echo "Push successful with output: $push_output"