-
Notifications
You must be signed in to change notification settings - Fork 20
[GOVCMSCT2-121] CT PORT - Fast fact card #1402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 15 commits
9a257a1
006540b
c9996b7
bb9b364
cf7d57f
af9ecdc
61dc9cc
ac0c3a1
29e985d
76a1c3b
5c7b4f5
6e76c02
c8d8a55
8b56da4
5d08d07
15bd089
07daef1
f966a90
406439c
a022720
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| # Fix EFS volume permissions based on lagoon.persistent labels | ||
| # | ||
| # Two approaches based on container configuration: | ||
| # 1. VOLUME_USER set: Use secure permissions with UID/GID 1000 (requires container remapping) | ||
| # 2. VOLUME_USER unset: Fall back to world-writable (777/666) for compatibility | ||
|
|
||
| echo "Fixing file permissions for EFS volumes..." | ||
|
|
||
| # Check if containers have been configured with UID/GID remapping | ||
| if [ -n "$VOLUME_USER" ]; then | ||
| echo "🔒 VOLUME_USER detected: Using secure permissions with UID/GID 1000" | ||
| echo " (Assumes containers remap www-data to UID/GID 1000 for EFS compatibility)" | ||
| PERMISSION_MODE="secure" | ||
| else | ||
| echo "⚠️ VOLUME_USER not set: Using world-writable permissions for compatibility" | ||
| echo " (Consider setting VOLUME_USER and remapping container users to UID/GID 1000)" | ||
| PERMISSION_MODE="compatible" | ||
| fi | ||
|
|
||
| # Persistent volume paths from docker-compose lagoon.persistent labels | ||
| for path in "/app/web/sites/default/files/"; do | ||
| if [ -d "$path" ]; then | ||
| echo "Fixing permissions for: $path" | ||
|
|
||
| if [ "$PERMISSION_MODE" = "secure" ]; then | ||
| # Set secure directory permissions (755 = rwxr-xr-x) | ||
| find "$path" -type d -exec chmod 755 {} + 2>/dev/null || true | ||
|
|
||
| # Set secure file permissions (644 = rw-r--r--) | ||
| find "$path" -type f -exec chmod 644 {} + 2>/dev/null || true | ||
|
|
||
| echo "✓ Secure permissions applied: $path (dirs: 755, files: 644)" | ||
| else | ||
| # Compatible approach: World-writable fallback | ||
|
|
||
| # Make directories world-writable (since we can't chown to unknown web server user) | ||
| find "$path" -type d -exec chmod 777 {} + 2>/dev/null || true | ||
|
|
||
| # Make files world-readable/writable (since we can't chown to unknown web server user) | ||
| find "$path" -type f -exec chmod 666 {} + 2>/dev/null || true | ||
|
|
||
| echo "✓ Compatible permissions applied: $path (dirs: 777, files: 666)" | ||
| fi | ||
| else | ||
| echo "Path not found (may not be mounted yet): $path" | ||
| fi | ||
| done | ||
|
|
||
| echo "Permission fixing completed for 1 volumes ($PERMISSION_MODE mode)" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,7 @@ | ||||||||||||||
| #!/bin/sh | ||||||||||||||
| set -e | ||||||||||||||
|
|
||||||||||||||
| # Post-rollout task: Show DrevOps variables. | ||||||||||||||
| # Generated from .lagoon.yml | ||||||||||||||
|
|
||||||||||||||
| env -0 | sort -z | tr '\0' '\n' | grep ^DREVOPS_ || true | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid GNU-only flags; add portable fallback. env -0 and sort -z aren’t available in BusyBox/Alpine by default; with set -e this may silently noop or fail. -env -0 | sort -z | tr '\0' '\n' | grep ^DREVOPS_ || true
+if env -0 >/dev/null 2>&1; then
+ env -0 | tr '\0' '\n' | sort | grep '^DREVOPS_' || true
+else
+ printenv | sort | grep '^DREVOPS_' || true
+fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| # Post-rollout task: Notify about pre-deployment. | ||
| # Generated from .lagoon.yml | ||
|
|
||
| if [ -n "$LAGOON_PR_NUMBER" ]; then export DREVOPS_NOTIFY_REF=$LAGOON_PR_NUMBER;export DREVOPS_NOTIFY_SHA=${LAGOON_PR_HEAD_SHA#origin/};export DREVOPS_NOTIFY_BRANCH=$LAGOON_PR_HEAD_BRANCH;else export DREVOPS_NOTIFY_REF=$LAGOON_GIT_BRANCH;export DREVOPS_NOTIFY_SHA=$LAGOON_GIT_SHA;export DREVOPS_NOTIFY_BRANCH=$LAGOON_GIT_BRANCH;fi | ||
| DREVOPS_NOTIFY_PROJECT=$LAGOON_PROJECT \ | ||
| DREVOPS_NOTIFY_ENVIRONMENT_URL=$LAGOON_ROUTE \ | ||
| DREVOPS_NOTIFY_EVENT=pre_deployment ./scripts/drevops/notify.sh || true | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| # Post-rollout task: Provision site | ||
| # Generated from .lagoon.yml | ||
| # COMMENTED OUT: This script contains rsync commands that won't work in Quant Cloud | ||
|
|
||
| # if [ "$LAGOON_ENVIRONMENT_TYPE" = "production" ] || [ "$LAGOON_GIT_BRANCH" = "${DREVOPS_LAGOON_PRODUCTION_BRANCH:-main}" ]; then | ||
| # echo "==> Running in PRODUCTION environment." | ||
| # # Never unblock admin user in production. | ||
| # export DRUPAL_UNBLOCK_ADMIN=0 | ||
| # # Never sanitize DB in production. | ||
| # export DREVOPS_PROVISION_SANITIZE_DB_SKIP=1 | ||
| # fi | ||
| # | ||
| # # Deployments from UI are not able to bypass the value of | ||
| # # DREVOPS_PROVISION_OVERRIDE_DB set by the deploy-lagoon.sh | ||
| # # during previous deployments (it sets value to '0' to mitigate Lagoon bug | ||
| # # where environment variables cannot be deleted and have to be set to a value). | ||
| # # @see https://github.com/uselagoon/lagoon/issues/1922 | ||
| # # Explicitly set DB overwrite flag to the value from .env file for | ||
| # # deployments from the profile. | ||
| # if [ "${DREVOPS_PROVISION_USE_PROFILE}" = "1" ]; then | ||
| # export DREVOPS_PROVISION_OVERRIDE_DB="$(cat .env | grep ^DREVOPS_PROVISION_OVERRIDE_DB | cut -c31-)" | ||
| # fi | ||
| # ./scripts/drevops/provision.sh | ||
|
|
||
| # NOTE: This provision script has been disabled because: | ||
| # - rsync commands try to connect to Lagoon SSH which is not available in Quant Cloud | ||
| # - Use DREVOPS_PROVISION_SKIP=1 environment variable to skip provision steps |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| # Post-rollout task: Send deployment notifications | ||
| # Generated from .lagoon.yml | ||
|
|
||
| if [ -n "$LAGOON_PR_NUMBER" ]; then export DREVOPS_NOTIFY_REF=$LAGOON_PR_NUMBER; export DREVOPS_NOTIFY_SHA=${LAGOON_PR_HEAD_SHA#origin/}; export DREVOPS_NOTIFY_BRANCH=$LAGOON_PR_HEAD_BRANCH; else export DREVOPS_NOTIFY_REF=$LAGOON_GIT_BRANCH; export DREVOPS_NOTIFY_SHA=$LAGOON_GIT_SHA; export DREVOPS_NOTIFY_BRANCH=$LAGOON_GIT_BRANCH; fi | ||
| DREVOPS_NOTIFY_EVENT=post_deployment \ | ||
| DREVOPS_NOTIFY_PROJECT=$LAGOON_PROJECT \ | ||
| DREVOPS_NOTIFY_ENVIRONMENT_URL=$LAGOON_ROUTE \ | ||
| ./scripts/drevops/notify.sh | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||||||||||||
| #!/bin/sh | ||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Fix EFS volume permissions based on lagoon.persistent labels | ||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||
| # Two approaches based on container configuration: | ||||||||||||||||||||||||||
| # 1. VOLUME_USER set: Use secure permissions with UID/GID 1000 (requires container remapping) | ||||||||||||||||||||||||||
| # 2. VOLUME_USER unset: Fall back to world-writable (777/666) for compatibility | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "Fixing file permissions for EFS volumes..." | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Check if containers have been configured with UID/GID remapping | ||||||||||||||||||||||||||
| if [ -n "$VOLUME_USER" ]; then | ||||||||||||||||||||||||||
| echo "🔒 VOLUME_USER detected: Using secure permissions with UID/GID 1000" | ||||||||||||||||||||||||||
| echo " (Assumes containers remap www-data to UID/GID 1000 for EFS compatibility)" | ||||||||||||||||||||||||||
| PERMISSION_MODE="secure" | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| echo "⚠️ VOLUME_USER not set: Using world-writable permissions for compatibility" | ||||||||||||||||||||||||||
| echo " (Consider setting VOLUME_USER and remapping container users to UID/GID 1000)" | ||||||||||||||||||||||||||
| PERMISSION_MODE="compatible" | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
|
Comment on lines
18
to
21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gate world-writable fallback. Same security concern as PHP entrypoint; require explicit ALLOW_WORLD_WRITABLE=1. - PERMISSION_MODE="compatible"
+ PERMISSION_MODE="compatible"
+ if [ "${ALLOW_WORLD_WRITABLE:-0}" != "1" ]; then
+ echo " Skipping world-writable fallback (set ALLOW_WORLD_WRITABLE=1 to enable)."
+ exit 0
+ fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Persistent volume paths from docker-compose lagoon.persistent labels | ||||||||||||||||||||||||||
| for path in "/app/web/sites/default/files/"; do | ||||||||||||||||||||||||||
| if [ -d "$path" ]; then | ||||||||||||||||||||||||||
| echo "Fixing permissions for: $path" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if [ "$PERMISSION_MODE" = "secure" ]; then | ||||||||||||||||||||||||||
| # Set secure directory permissions (755 = rwxr-xr-x) | ||||||||||||||||||||||||||
| find "$path" -type d -exec chmod 755 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Set secure file permissions (644 = rw-r--r--) | ||||||||||||||||||||||||||
| find "$path" -type f -exec chmod 644 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "✓ Secure permissions applied: $path (dirs: 755, files: 644)" | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| # Compatible approach: World-writable fallback | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Make directories world-writable (since we can't chown to unknown web server user) | ||||||||||||||||||||||||||
| find "$path" -type d -exec chmod 777 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Make files world-readable/writable (since we can't chown to unknown web server user) | ||||||||||||||||||||||||||
| find "$path" -type f -exec chmod 666 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "✓ Compatible permissions applied: $path (dirs: 777, files: 666)" | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| echo "Path not found (may not be mounted yet): $path" | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "Permission fixing completed for 1 volumes ($PERMISSION_MODE mode)" | ||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||||||||||||
| #!/bin/sh | ||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Fix EFS volume permissions based on lagoon.persistent labels | ||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||
| # Two approaches based on container configuration: | ||||||||||||||||||||||||||
| # 1. VOLUME_USER set: Use secure permissions with UID/GID 1000 (requires container remapping) | ||||||||||||||||||||||||||
| # 2. VOLUME_USER unset: Fall back to world-writable (777/666) for compatibility | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "Fixing file permissions for EFS volumes..." | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Check if containers have been configured with UID/GID remapping | ||||||||||||||||||||||||||
| if [ -n "$VOLUME_USER" ]; then | ||||||||||||||||||||||||||
| echo "🔒 VOLUME_USER detected: Using secure permissions with UID/GID 1000" | ||||||||||||||||||||||||||
| echo " (Assumes containers remap www-data to UID/GID 1000 for EFS compatibility)" | ||||||||||||||||||||||||||
| PERMISSION_MODE="secure" | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| echo "⚠️ VOLUME_USER not set: Using world-writable permissions for compatibility" | ||||||||||||||||||||||||||
| echo " (Consider setting VOLUME_USER and remapping container users to UID/GID 1000)" | ||||||||||||||||||||||||||
| PERMISSION_MODE="compatible" | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
|
Comment on lines
18
to
21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. World-writable fallback needs an explicit opt-in. 777/666 on web writable dirs is risky in prod. Gate with an env flag. - PERMISSION_MODE="compatible"
+ PERMISSION_MODE="compatible"
+ if [ "${ALLOW_WORLD_WRITABLE:-0}" != "1" ]; then
+ echo " Skipping world-writable fallback (set ALLOW_WORLD_WRITABLE=1 to enable)."
+ exit 0
+ fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Persistent volume paths from docker-compose lagoon.persistent labels | ||||||||||||||||||||||||||
| for path in "/app/web/sites/default/files/"; do | ||||||||||||||||||||||||||
| if [ -d "$path" ]; then | ||||||||||||||||||||||||||
| echo "Fixing permissions for: $path" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if [ "$PERMISSION_MODE" = "secure" ]; then | ||||||||||||||||||||||||||
| # Set secure directory permissions (755 = rwxr-xr-x) | ||||||||||||||||||||||||||
| find "$path" -type d -exec chmod 755 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Set secure file permissions (644 = rw-r--r--) | ||||||||||||||||||||||||||
| find "$path" -type f -exec chmod 644 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "✓ Secure permissions applied: $path (dirs: 755, files: 644)" | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| # Compatible approach: World-writable fallback | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Make directories world-writable (since we can't chown to unknown web server user) | ||||||||||||||||||||||||||
| find "$path" -type d -exec chmod 777 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Make files world-readable/writable (since we can't chown to unknown web server user) | ||||||||||||||||||||||||||
| find "$path" -type f -exec chmod 666 {} + 2>/dev/null || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "✓ Compatible permissions applied: $path (dirs: 777, files: 666)" | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| echo "Path not found (may not be mounted yet): $path" | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "Permission fixing completed for 1 volumes ($PERMISSION_MODE mode)" | ||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| name: Build and Push civictheme-monorepo-drupal to Quant Cloud | ||
| 'on': | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| - develop | ||
| - quant-cloud-migration | ||
| - feature/* | ||
| tags: | ||
| - '*' | ||
| pull_request: | ||
| branches: '*' | ||
|
|
||
| concurrency: | ||
| group: build-and-push-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| runs-on: sh-runner-1-arm64 | ||
| steps: | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Initialize Quant Cloud | ||
| uses: quantcdn/[email protected] | ||
| id: init | ||
| with: | ||
| quant_organization: ${{ secrets.QUANT_ORGANIZATION }} | ||
| quant_api_key: ${{ secrets.QUANT_API_KEY }} | ||
| quant_application: civictheme-monorepo-drupal | ||
| master_branch_override: main | ||
|
|
||
|
Comment on lines
32
to
40
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skip Quant init on pull_request to avoid secret access failures. This step uses secrets; forks won’t have them. - - name: Initialize Quant Cloud
+ - name: Initialize Quant Cloud
+ if: ${{ github.event_name != 'pull_request' }}
uses: quantcdn/[email protected]🤖 Prompt for AI Agents |
||
| - name: Override outputs for quant-cloud-migration branch | ||
| id: override-outputs | ||
| run: |- | ||
| # Override outputs for quant-cloud-migration branch to treat it as production | ||
| if [[ "${{ github.ref }}" == "refs/heads/quant-cloud-migration" ]]; then | ||
| echo "image_suffix=-latest" >> $GITHUB_OUTPUT | ||
| echo "image_suffix_clean=latest" >> $GITHUB_OUTPUT | ||
| echo "is_production=true" >> $GITHUB_OUTPUT | ||
| echo "environment_name=production" >> $GITHUB_OUTPUT | ||
| echo "environment_exists=true" >> $GITHUB_OUTPUT | ||
| echo "Overriding outputs for quant-cloud-migration branch: using -latest suffix and production environment" | ||
| else | ||
| # Use the original action outputs | ||
| echo "image_suffix=${{ steps.init.outputs.image_suffix }}" >> $GITHUB_OUTPUT | ||
| # Remove leading hyphen from image_suffix for image_suffix parameter | ||
| suffix="${{ steps.init.outputs.image_suffix }}" | ||
| clean_suffix="${suffix#-}" | ||
| echo "image_suffix_clean=$clean_suffix" >> $GITHUB_OUTPUT | ||
| echo "is_production=${{ steps.init.outputs.is_production }}" >> $GITHUB_OUTPUT | ||
| echo "environment_name=${{ steps.init.outputs.environment_name }}" >> $GITHUB_OUTPUT | ||
| echo "environment_exists=${{ steps.init.outputs.environment_exists }}" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Build and push cli image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| file: ./.docker/cli.dockerfile | ||
| platforms: linux/arm64 | ||
| push: true | ||
| tags: ${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application | ||
| }}:cli${{ steps.override-outputs.outputs.image_suffix }} | ||
| cache-from: |- | ||
| type=gha | ||
| type=registry,ref=${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application }}:cli-cache | ||
| cache-to: type=gha,mode=max | ||
| build-args: CLI_IMAGE=${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application | ||
| }}:cli${{ steps.override-outputs.outputs.image_suffix }} | ||
|
|
||
|
Comment on lines
64
to
79
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid pushing images on pull_request events. Prevents failing builds from forks and unnecessary registry pollution. - - name: Build and push cli image
+ - name: Build and push cli image
+ if: ${{ github.event_name != 'pull_request' }}
@@
- - name: Build and push nginx image
+ - name: Build and push nginx image
+ if: ${{ github.event_name != 'pull_request' }}
@@
- - name: Build and push php image
+ - name: Build and push php image
+ if: ${{ github.event_name != 'pull_request' }}Also applies to: 78-93, 94-109 🤖 Prompt for AI Agents |
||
| - name: Build and push nginx image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| file: ./.docker/nginx-drupal.dockerfile | ||
| platforms: linux/arm64 | ||
| push: true | ||
| tags: ${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application | ||
| }}:nginx${{ steps.override-outputs.outputs.image_suffix }} | ||
| cache-from: |- | ||
| type=gha | ||
| type=registry,ref=${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application }}:nginx-cache | ||
| cache-to: type=gha,mode=max | ||
| build-args: CLI_IMAGE=${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application | ||
| }}:cli${{ steps.override-outputs.outputs.image_suffix }} | ||
|
|
||
| - name: Build and push php image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| file: ./.docker/php.dockerfile | ||
| platforms: linux/arm64 | ||
| push: true | ||
| tags: ${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application | ||
| }}:php${{ steps.override-outputs.outputs.image_suffix }} | ||
| cache-from: |- | ||
| type=gha | ||
| type=registry,ref=${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application }}:php-cache | ||
| cache-to: type=gha,mode=max | ||
| build-args: CLI_IMAGE=${{ steps.init.outputs.stripped_endpoint }}/${{ secrets.QUANT_ORGANIZATION }}/${{ steps.init.outputs.quant_application | ||
| }}:cli${{ steps.override-outputs.outputs.image_suffix }} | ||
|
|
||
| - name: Create environment if it doesn't exist | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.override-outputs.outputs.environment_exists == 'false' }} | ||
| uses: quantcdn/[email protected] | ||
| with: | ||
| api_key: ${{ secrets.QUANT_API_KEY }} | ||
| organization: ${{ secrets.QUANT_ORGANIZATION }} | ||
| app_name: ${{ steps.init.outputs.quant_application }} | ||
| environment_name: ${{ steps.override-outputs.outputs.environment_name }} | ||
| from_environment: production | ||
| image_suffix: ${{ steps.override-outputs.outputs.image_suffix_clean }} | ||
|
|
||
| - name: Sync database from production to new environment | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.override-outputs.outputs.environment_exists == 'false' && steps.override-outputs.outputs.environment_name | ||
| != 'production' }} | ||
| uses: quantcdn/[email protected] | ||
| with: | ||
| api_key: ${{ secrets.QUANT_API_KEY }} | ||
| organization: ${{ secrets.QUANT_ORGANIZATION }} | ||
| app_name: ${{ steps.init.outputs.quant_application }} | ||
| environment_name: ${{ steps.override-outputs.outputs.environment_name }} | ||
| source: production | ||
| type: database | ||
| wait: true | ||
| wait_interval: 10 | ||
| max_retries: 30 | ||
|
|
||
| - name: Redeploy existing environment | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.override-outputs.outputs.environment_exists == 'true' }} | ||
| uses: quantcdn/quant-cloud-environment-state-action@v1 | ||
| with: | ||
| api_key: ${{ secrets.QUANT_API_KEY }} | ||
| organization: ${{ secrets.QUANT_ORGANIZATION }} | ||
| application: ${{ steps.init.outputs.quant_application }} | ||
| environment: ${{ steps.override-outputs.outputs.environment_name }} | ||
| action: redeploy | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gate world-writable fallback.
Avoid enabling 777/666 unless explicitly approved for the environment.
📝 Committable suggestion
🤖 Prompt for AI Agents