This repository was archived by the owner on Jan 3, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -153,13 +153,22 @@ jobs:
153153 VERSION="$1"
154154 BRANCH="$2"
155155 ENVIRONMENT="$3"
156+ REGISTRY_USERNAME="$4"
157+ REGISTRY_PASSWORD="$5"
158+
156159 if [ -z "$VERSION" ] || [ -z "$BRANCH" ] || [ -z "$ENVIRONMENT" ]; then
157- echo "Usage: $0 <version> <branch> <environment>"
160+ echo "Usage: $0 <version> <branch> <environment> [registry_username] [registry_password] "
158161 exit 1
159162 fi
160163 echo "Deploying version: $VERSION, branch: $BRANCH, environment: $ENVIRONMENT"
161-
164+
162165 docker compose -f docker-compose.yaml -f docker-compose.override.yaml down || true
166+
167+ if [ -n "$REGISTRY_USERNAME" ] && [ -n "$REGISTRY_PASSWORD" ]; then
168+ echo "Logging into registry ghcr.io..."
169+ echo "$REGISTRY_PASSWORD" | docker login ghcr.io -u "$REGISTRY_USERNAME" --password-stdin
170+ fi
171+
163172 docker pull ghcr.io/safeturned/website:v${VERSION}
164173 docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
165174 sleep 10
@@ -188,5 +197,5 @@ jobs:
188197 echo "=== Starting website deployment ==="
189198 cd ${{ steps.branch.outputs.branch == 'dev' && '/opt/dev-safeturned-website/deploy' || '/opt/safeturned-website/deploy' }}
190199 chmod +x deploy.sh
191- ./deploy.sh "${{ steps.version.outputs.version }}" "${{ steps.branch.outputs.branch }}" "${{ steps.branch.outputs.environment }}"
200+ ./deploy.sh "${{ steps.version.outputs.version }}" "${{ steps.branch.outputs.branch }}" "${{ steps.branch.outputs.environment }}" "${{ github.repository_owner }}" "${{ secrets.GITHUB_TOKEN }}"
192201 echo "=== Website deployment completed ==="
You can’t perform that action at this time.
0 commit comments