Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
6cb3699016 | |||
2734dd8c58 | |||
f191fe9e4a |
@ -40,13 +40,14 @@ jobs:
|
||||
build-args: |
|
||||
HUGO_BASEURL=https://comprofix.com/
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
deploy:
|
||||
runs-on: homelab-latest
|
||||
needs: build-and-push
|
||||
env:
|
||||
DEPLOY_USER: administrator
|
||||
DEPLOY_HOST: docker.comprofix.xyz
|
||||
DEPLOY_PATH: /opt/comprofix
|
||||
VERSION: ${{ github.ref_name }} # <-- get the tag that triggered this workflow
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -65,11 +66,8 @@ deploy:
|
||||
echo "Deploying production container..."
|
||||
ssh -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST "
|
||||
cd $DEPLOY_PATH
|
||||
# Extract Git tag that triggered the workflow
|
||||
VERSION=\${GITHUB_REF#refs/tags/}
|
||||
|
||||
# Update IMAGE_TAG in .env.production
|
||||
sed -i 's/^IMAGE_TAG=.*/IMAGE_TAG=\$VERSION/' .env.production
|
||||
# Replace IMAGE_TAG with the version from CI
|
||||
sed -i 's/^IMAGE_TAG=.*/IMAGE_TAG=${VERSION}/' .env.production
|
||||
|
||||
# Stop old container, pull new image, start container
|
||||
docker compose --env-file .env.production down --remove-orphans
|
||||
|
Reference in New Issue
Block a user