Skip to content

Commit ece1ad4

Browse files
authored
Merge pull request #19 from tolik518/dependencies-and-deploy
2 parents 0b8d734 + a25baee commit ece1ad4

6 files changed

Lines changed: 511 additions & 222 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ jobs:
3131
- uses: actions/checkout@v4
3232
with:
3333
fetch-depth: 0
34+
3435
- name: Extract version from Cargo.toml
3536
run: |
3637
VERSION=$(grep '^version' strong-api-fetch/Cargo.toml | head -n 1 | sed -E 's/version *= *"([^"]+)".*/\1/')
3738
echo "VERSION=$VERSION" >> $GITHUB_ENV
3839
echo "Version extracted: $VERSION"
40+
3941
- name: Check existing tag
4042
id: check_tag
4143
run: |
@@ -48,6 +50,7 @@ jobs:
4850
echo "New version detected: $VERSION"
4951
echo "tag_created=true" >> $GITHUB_OUTPUT
5052
fi
53+
5154
- name: Create and push Git tag
5255
if: steps.check_tag.outputs.tag_created == 'true'
5356
run: |
@@ -64,11 +67,13 @@ jobs:
6467
name: production
6568
steps:
6669
- uses: actions/checkout@v4
70+
6771
- name: Extract version from Cargo.toml
6872
run: |
6973
VERSION=$(grep '^version' strong-api-fetch/Cargo.toml | head -n 1 | sed -E 's/version *= *"([^"]+)".*/\1/')
7074
echo "VERSION=$VERSION" >> $GITHUB_ENV
7175
echo "Version extracted: $VERSION"
76+
7277
- name: SSH into Server and Deploy
7378
env:
7479
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
@@ -103,5 +108,10 @@ jobs:
103108
fi
104109
echo "Deployment successful - container is running"
105110
EOF
111+
112+
if [ $? -ne 0 ]; then
113+
echo "Deployment failed"
114+
exit 1
115+
fi
106116
107117
rm -f private_key.pem

0 commit comments

Comments
 (0)