more ci/cd deploy fixes
This commit is contained in:
11
.github/workflows/deploy.yml
vendored
11
.github/workflows/deploy.yml
vendored
@@ -74,12 +74,19 @@ jobs:
|
|||||||
cd ${{ secrets.DEPLOY_PATH }}
|
cd ${{ secrets.DEPLOY_PATH }}
|
||||||
echo "Logged into server: $(pwd)"
|
echo "Logged into server: $(pwd)"
|
||||||
|
|
||||||
|
# Log into GHCR on mara
|
||||||
|
echo "Logging into GHCR..."
|
||||||
|
echo ${{ secrets.DOCKER_REGISTRY_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
|
||||||
|
echo "GHCR login completed."
|
||||||
|
|
||||||
|
|
||||||
# Pull the specific image version built in this workflow
|
# Pull the specific image version built in this workflow
|
||||||
# Using the Git SHA ensures we deploy exactly what was just built
|
# Using the Git SHA ensures we deploy exactly what was just built
|
||||||
|
echo "Pulling image ${{ github.sha }}..."
|
||||||
docker pull ghcr.io/${{ github.repository_owner }}/maia:${{ github.sha }}
|
docker pull ghcr.io/${{ github.repository_owner }}/maia:${{ github.sha }}
|
||||||
|
|
||||||
# Also pull latest for other services to keep up to date
|
# Also pull latest for other services to keep up to date
|
||||||
docker-compose pull redis db
|
docker compose pull redis db
|
||||||
|
|
||||||
# Uses sed to update the compose file with the new image tag
|
# Uses sed to update the compose file with the new image tag
|
||||||
sed -i 's|image: ghcr.io/${{ github.repository_owner }}/maia:.*|image: ghcr.io/${{ github.repository_owner }}/maia:${{ github.sha }}|g' docker-compose.yml
|
sed -i 's|image: ghcr.io/${{ github.repository_owner }}/maia:.*|image: ghcr.io/${{ github.repository_owner }}/maia:${{ github.sha }}|g' docker-compose.yml
|
||||||
@@ -87,5 +94,5 @@ jobs:
|
|||||||
|
|
||||||
# Restart the services using the new image(s)
|
# Restart the services using the new image(s)
|
||||||
echo "Bringing compose stack down and up with new image..."
|
echo "Bringing compose stack down and up with new image..."
|
||||||
docker-compose up -d --force-recreate --remove-orphans api worker db redis
|
docker compose up -d --force-recreate --remove-orphans api worker db redis
|
||||||
echo "Deployment complete!"
|
echo "Deployment complete!"
|
||||||
Reference in New Issue
Block a user