-
-
Notifications
You must be signed in to change notification settings - Fork 0
Allow to deploy manually. #156
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
Changes from all commits
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,9 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This configuration file uses a custom "container" executor to run the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Docker stack to speed up the build process. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #; Comments starting with '#;<' and '#;>' are internal Vortex comments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #; and will be removed during installation or update of Vortex. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Database, Build, Test and Deploy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -37,13 +40,25 @@ on: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deploy_target: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: 'Deploy target: "<branch>" or "PR-<num>"<br/> next line' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| override_db: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: 'Override existing database' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enable_terminal: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: 'Enable terminal session.' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: 'Enable terminal session' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - cron: '0 18 * * *' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defaults: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -59,11 +74,13 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| lint: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event_name != 'schedule' && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.deploy_target && github.event_name != 'schedule' && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| container: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://hub.docker.com/r/drevops/ci-runner | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.2.0@sha256:fe1561c2984a1023e84eebe6461056b0b55afedbb2512e6c2c7f19aca6beb398 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.3.0@sha256:788b02ff938be5e3c1d915d786b4be3b6453ac6091eaaa50d1414552d5131e97 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -114,7 +131,9 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c " \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n \"${PACKAGE_TOKEN:-}\" ]; then export COMPOSER_AUTH='{\"github-oauth\": {\"github.com\": \"${PACKAGE_TOKEN-}\"}}'; fi && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMPOSER_MEMORY_LIMIT=-1 composer --ansi install --prefer-dist" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_ESLINT_STYLELINT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "yarn install --frozen-lockfile" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_ESLINT_STYLELINT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Audit Composer packages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli composer audit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -124,42 +143,61 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli composer normalize --dry-run | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_COMPOSER_NORMALIZE_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_PHPCS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint code with PHPCS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli vendor/bin/phpcs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_PHPCS_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_PHPCS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_PHPSTAN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint code with PHPStan | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli vendor/bin/phpstan | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_PHPSTAN_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_PHPSTAN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_RECTOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint code with Rector | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli vendor/bin/rector --dry-run | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_RECTOR_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_RECTOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_PHPMD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint code with PHPMD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli vendor/bin/phpmd . text phpmd.xml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_PHPMD_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_PHPMD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint code with Twig CS Fixer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli vendor/bin/twig-cs-fixer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_BEHAT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint code with Gherkin Lint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_BEHAT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_ESLINT_STYLELINT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint module code with NodeJS linters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli bash -c "yarn run lint" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_ESLINT_STYLELINT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< DRUPAL_THEME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint theme code with NodeJS linters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ vars.VORTEX_FRONTEND_BUILD_SKIP != '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli bash -c "yarn --cwd=\${WEBROOT}/themes/custom/\${DRUPAL_THEME} run lint" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> DRUPAL_THEME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| database: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event_name == 'push' || !startsWith(github.head_ref, 'project/') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.deploy_target && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| container: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://hub.docker.com/r/drevops/ci-runner | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.2.0@sha256:fe1561c2984a1023e84eebe6461056b0b55afedbb2512e6c2c7f19aca6beb398 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.3.0@sha256:788b02ff938be5e3c1d915d786b4be3b6453ac6091eaaa50d1414552d5131e97 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -235,6 +273,16 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DOWNLOAD_DB_SEMAPHORE=/tmp/download-db-success ./scripts/vortex/download-db.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "db_hash=${{ hashFiles('.data') }}" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< DB_DOWNLOAD_SOURCE_ACQUIA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_ACQUIA_KEY: ${{ secrets.VORTEX_ACQUIA_KEY }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_ACQUIA_SECRET: ${{ secrets.VORTEX_ACQUIA_SECRET }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> DB_DOWNLOAD_SOURCE_ACQUIA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< MIGRATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download migration DB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: VORTEX_DB_INDEX=2 ./scripts/vortex/download-db.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> MIGRATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+283
to
+285
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. 🧩 Analysis chain🏁 Script executed: cd /tmp && git ls-files .github/workflows/build-test-deploy.ymlRepository: drevops/website Length of output: 129 🏁 Script executed: sed -n '270,290p' .github/workflows/build-test-deploy.yml | cat -nRepository: drevops/website Length of output: 1042 🏁 Script executed: find . -type f -name "download-db.sh" | head -5Repository: drevops/website Length of output: 90 🏁 Script executed: cat ./scripts/vortex/download-db.sh | head -100Repository: drevops/website Length of output: 3897 🏁 Script executed: grep -r "VORTEX_DOWNLOAD_DB.*_SOURCE" .github/workflows/ .env* 2>/dev/null | head -20Repository: drevops/website Length of output: 96 🏁 Script executed: grep -r "VORTEX_DOWNLOAD_DB2_SOURCE\|VORTEX_DOWNLOAD_DB_SOURCE" . --include="*.md" --include="*.env*" --include="*.yml" 2>/dev/null | head -20Repository: drevops/website Length of output: 98 🏁 Script executed: cat ./scripts/vortex/download-db-acquia.sh | head -80Repository: drevops/website Length of output: 3312 🏁 Script executed: grep -r "VORTEX_DOWNLOAD_DB2_SOURCE\|VORTEX_DB2_" . --include="*.env*" --include="*.yml" 2>/dev/nullRepository: drevops/website Length of output: 41 🏁 Script executed: grep -r "VORTEX_DB_INDEX" .github/workflows/ 2>/dev/nullRepository: drevops/website Length of output: 161 Mirror the primary DB download step's env and timeout. This second Suggested fix - name: Download migration DB
run: VORTEX_DB_INDEX=2 ./scripts/vortex/download-db.sh
+ timeout-minutes: 30
+ #;< DB_DOWNLOAD_SOURCE_ACQUIA
+ env:
+ VORTEX_ACQUIA_KEY: ${{ secrets.VORTEX_ACQUIA_KEY }}
+ VORTEX_ACQUIA_SECRET: ${{ secrets.VORTEX_ACQUIA_SECRET }}
+ #;> DB_DOWNLOAD_SOURCE_ACQUIA🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Export DB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -256,11 +304,14 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: .data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: v26.2.0-db11-${{ hashFiles('db_cache_branch') }}-${{ hashFiles('db_cache_fallback_yes') }}-${{ hashFiles('db_cache_timestamp') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: database | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event_name != 'schedule' && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.deploy_target && github.event_name != 'schedule' && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # A matrix to run multiple jobs in parallel. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -270,7 +321,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| container: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://hub.docker.com/r/drevops/ci-runner | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.2.0@sha256:fe1561c2984a1023e84eebe6461056b0b55afedbb2512e6c2c7f19aca6beb398 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.3.0@sha256:788b02ff938be5e3c1d915d786b4be3b6453ac6091eaaa50d1414552d5131e97 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -281,6 +332,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_SSH_REMOVE_ALL_KEYS: "1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # How often to refresh the cache of the DB dump. Refer to `date` command. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CI_DB_CACHE_TIMESTAMP: +%Y%m%d | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Use previous database caches on this branch as a fallback if the above cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -289,6 +341,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CI_DB_CACHE_FALLBACK: "yes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Which branch to use as a source of DB caches. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CI_DB_CACHE_BRANCH: "develop" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Preserve $HOME set in the container | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -310,6 +363,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: composer validate --strict | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_COMPOSER_VALIDATE_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create cache keys files for database caching | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "${VORTEX_CI_DB_CACHE_BRANCH}" | tee db_cache_branch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -332,6 +386,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: v26.2.0-db11-${{ hashFiles('db_cache_branch') }}-${{ hashFiles('db_cache_fallback_yes') }}-${{ hashFiles('db_cache_timestamp') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| v26.2.0-db11-${{ hashFiles('db_cache_branch') }}-${{ hashFiles('db_cache_fallback_yes') }}- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Login to container registry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: ./scripts/vortex/login-container-registry.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -359,9 +414,16 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose exec cli mkdir -p .data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose cp -L .data/db.sql cli:/app/.data/db.sql | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< MIGRATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -f ".data/${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql}" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose exec -T cli mkdir -p .data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose cp -L ".data/${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql}" cli:"/app/.data/${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> MIGRATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli ./scripts/vortex/provision.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_PHPUNIT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Test with PHPUnit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: docker compose exec -T cli vendor/bin/phpunit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -381,8 +443,15 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RATE=$(grep -om1 'line-rate="[0-9.]*"' .logs/coverage/phpunit/cobertura.xml | tr -cd '0-9.') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Coverage: $PERCENT% (threshold: $VORTEX_CI_CODE_COVERAGE_THRESHOLD%)" | tee -a "$GITHUB_STEP_SUMMARY" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "COVERAGE_PERCENT=${PERCENT}" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { echo "COVERAGE_CONTENT<<EOF"; sed '/./,$!d' .logs/coverage/phpunit/coverage.txt; echo "EOF"; } >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "COVERAGE_PERCENT=${PERCENT}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "COVERAGE_SUMMARY<<EOF" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| awk '/^ *Summary:/{f=1;next} f && /^$/{exit} f' .logs/coverage/phpunit/coverage.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "EOF" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "COVERAGE_DETAILS<<EOF" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| awk 'BEGIN{s=0} /^ *Summary:/{s=1} s==1 && /^$/{s=2;next} s==2' .logs/coverage/phpunit/coverage.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "EOF" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -392,10 +461,17 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| header: coverage-gha | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Code coverage (GitHub Actions)** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Code coverage** (threshold: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${{ env.COVERAGE_CONTENT }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${{ env.COVERAGE_SUMMARY }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <details> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <summary>Per-class coverage</summary> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${{ env.COVERAGE_DETAILS }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </details> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hide_and_recreate: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload coverage report to Codecov | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -417,7 +493,9 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_PHPUNIT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< TOOL_BEHAT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Test with Behat | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # shellcheck disable=SC2170 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -429,6 +507,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_CI_BEHAT_PROFILE: ${{ vars.VORTEX_CI_BEHAT_PROFILE }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.VORTEX_CI_BEHAT_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> TOOL_BEHAT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Process test logs and artifacts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -464,14 +543,17 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detached: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< DEPLOYMENT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deploy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [build, lint] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;< !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ !cancelled() && (inputs.deploy_target || (github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')))) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> !PROVISION_TYPE_PROFILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| container: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://hub.docker.com/r/drevops/ci-runner | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.2.0@sha256:fe1561c2984a1023e84eebe6461056b0b55afedbb2512e6c2c7f19aca6beb398 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: drevops/ci-runner:26.3.0@sha256:788b02ff938be5e3c1d915d786b4be3b6453ac6091eaaa50d1414552d5131e97 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TZ: ${{ vars.TZ || 'UTC' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TERM: xterm-256color | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -482,6 +564,19 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Preserve $HOME set in the container | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: echo HOME=/root >> "$GITHUB_ENV" # https://github.com/actions/runner/issues/863 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Resolve deploy target | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ inputs.deploy_target }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEPLOY_TARGET: ${{ inputs.deploy_target }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ github.token }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "DEPLOY_BRANCH=${DEPLOY_TARGET}" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if echo "${DEPLOY_TARGET}" | grep -iq '^pr-'; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "DEPLOY_PR_NUMBER=${DEPLOY_TARGET#*-}" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "DEPLOY_BRANCH=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+567
to
+578
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. 🧹 Nitpick | 🔵 Trivial Add error handling for PR resolution. If the PR number is invalid or the PR doesn't exist, Consider adding validation and error handling: Suggested improvement - name: Resolve deploy target
if: ${{ inputs.deploy_target }}
env:
DEPLOY_TARGET: ${{ inputs.deploy_target }}
GH_TOKEN: ${{ github.token }}
run: |
echo "DEPLOY_BRANCH=${DEPLOY_TARGET}" >> "$GITHUB_ENV"
if echo "${DEPLOY_TARGET}" | grep -iq '^pr-'; then
- echo "DEPLOY_PR_NUMBER=${DEPLOY_TARGET#*-}" >> "$GITHUB_ENV"
- echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV"
- echo "DEPLOY_BRANCH=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV"
+ PR_NUM="${DEPLOY_TARGET#*-}"
+ if ! [[ "${PR_NUM}" =~ ^[0-9]+$ ]]; then
+ echo "::error::Invalid PR number format: ${PR_NUM}. Expected 'pr-<number>'."
+ exit 1
+ fi
+ if ! gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json state --jq '.state' > /dev/null 2>&1; then
+ echo "::error::PR #${PR_NUM} not found or inaccessible."
+ exit 1
+ fi
+ echo "DEPLOY_PR_NUMBER=${PR_NUM}" >> "$GITHUB_ENV"
+ echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV"
+ echo "DEPLOY_BRANCH=$(gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV"
fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -490,23 +585,24 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Do not persist credentials after checkout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # to allow using the custom credentials to push to a remote repo. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| persist-credentials: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ github.head_ref || github.ref_name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ env.DEPLOY_BRANCH || github.head_ref || github.ref_name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Fix Git ownership permissions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Load environment variables from .env | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && set +a && . "${t}" && env >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Artifact deployments do not work for manual deploys as the build job is skipped. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download exported codebase as an artifact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: code-artifact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: "/tmp/artifacts" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Unpack downloaded exported codebase | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+599
to
606
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. 🧩 Analysis chain🏁 Script executed: # First, let's get the size and read the workflow file
wc -l .github/workflows/build-test-deploy.ymlRepository: drevops/website Length of output: 102 🏁 Script executed: # Read the relevant sections around lines 588-595 and 615
sed -n '580,630p' .github/workflows/build-test-deploy.ymlRepository: drevops/website Length of output: 2690 🏁 Script executed: # Search for VORTEX_DEPLOY_ARTIFACT_SRC and VORTEX_DEPLOY_TYPES to understand the flow
rg "VORTEX_DEPLOY_ARTIFACT_SRC|VORTEX_DEPLOY_TYPES" .github/workflows/build-test-deploy.yml -nRepository: drevops/website Length of output: 614 🏁 Script executed: # Also search for where deploy_target is used and how it affects artifact handling
rg "inputs.deploy_target" .github/workflows/build-test-deploy.yml -B 2 -A 2 -nRepository: drevops/website Length of output: 1845 🏁 Script executed: sed -n '610,620p' .github/workflows/build-test-deploy.ymlRepository: drevops/website Length of output: 524 🏁 Script executed: # Let's also check if there's any other artifact download/unpack step or similar condition
rg "Download|Unpack|artifact" .github/workflows/build-test-deploy.yml -nRepository: drevops/website Length of output: 1594 🏁 Script executed: sed -n '615,615p' .github/workflows/build-test-deploy.ymlRepository: drevops/website Length of output: 93 🏁 Script executed: # Also check the context around it
sed -n '620,635p' .github/workflows/build-test-deploy.ymlRepository: drevops/website Length of output: 1246 Reject manual artifact deployments to prevent failures. The download and unpack steps skip when Add a guard to explicitly reject this unsupported configuration: Suggested guard - name: Load environment variables from .env
run: t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && set +a && . "${t}" && env >> "$GITHUB_ENV"
+
+ - name: Reject manual artifact deploys until artifact preparation exists
+ if: ${{ inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }}
+ run: |
+ echo "Manual deploys are not supported for artifact deployments because the build job is skipped."
+ exit 1🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p /tmp/workspace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tar -xpf /tmp/artifacts/code.tar -C /tmp/workspace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -524,10 +620,9 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: ./scripts/vortex/deploy.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_MODE: ${{ startsWith(github.ref, 'refs/tags/') && 'tag' || 'branch' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Get branch for PR from 'head_ref' or for branch from 'ref_name'. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_BRANCH: ${{ github.head_ref || github.ref_name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_PR: ${{ github.event.number }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_PR_HEAD: ${{ github.event.pull_request.head.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_BRANCH: ${{ env.DEPLOY_BRANCH || github.head_ref || github.ref_name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_PR: ${{ env.DEPLOY_PR_NUMBER || github.event.number }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_PR_HEAD: ${{ env.DEPLOY_PR_HEAD_SHA || github.event.pull_request.head.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_ARTIFACT_SRC: /tmp/workspace/code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_ARTIFACT_ROOT: ${{ github.workspace }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE: ${{ vars.VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -538,4 +633,6 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_ALLOW_SKIP: ${{ vars.VORTEX_DEPLOY_ALLOW_SKIP }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_SKIP_PRS: ${{ vars.VORTEX_DEPLOY_SKIP_PRS }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_SKIP_BRANCHES: ${{ vars.VORTEX_DEPLOY_SKIP_BRANCHES }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VORTEX_DEPLOY_ACTION: ${{ inputs.override_db && 'deploy_override_db' || '' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #;> DEPLOYMENT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: drevops/website
Length of output: 1020
🏁 Script executed:
Repository: drevops/website
Length of output: 879
🏁 Script executed:
Repository: drevops/website
Length of output: 1088
🌐 Web query:
GitHub Actions job needs dependency skipped if condition semantics💡 Result:
In GitHub Actions, a job that declares
needs:is implicitly gated byif: success(). So if any job in its dependency chain is skipped (or fails/cancels), downstream jobs are skipped by default (“a failure or skip applies to all jobs in the dependency chain…”). [1]To override that default and decide yourself, put
always()in the dependent job’sif:(this removes the implicitsuccess()gate), then check dependency results vianeeds.<job_id>.result(values:success,failure,cancelled,skipped). [1][2]Example: run
deployeven ifbuildwas skipped, but not if it failed/cancelled:If you only write
if: needs.build.result == 'skipped'withoutalways(),deploywill still be skipped, because the implicitsuccess()gate prevents the job from running/evaluating as you expect when a dependency is skipped. [1][3]Sources: GitHub Docs on dependency-chain skip behavior and using
always()[1], and onneeds.<job_id>.resultvalues [2], plus GitHub Community discussion ofsuccess()being false when dependencies are skipped [3].[1] (docs.github.com)
[2] (docs.github.com)
[3] (github.com)
Citations:
🏁 Script executed:
Repository: drevops/website
Length of output: 1081
Manual
deploy_targetruns are blocked by the implicit success gate on job dependencies.When
inputs.deploy_targetis set, thelintandbuildjobs are skipped by theirifconditions (lines 78 and 313). However, thedeployjob declaresneeds: [build, lint]withoutalways(), which adds an implicitif: success()gate to the entire dependency chain. GitHub Actions will skip thedeployjob when its dependencies are skipped, regardless of the explicitifcondition on line 551 evaluating to true.Use
always()to remove the implicit success gate and explicitly check dependency results only for the normal (non-manual) deployment path:Suggested fix
deploy: runs-on: ubuntu-latest needs: [build, lint] - if: ${{ !cancelled() && (inputs.deploy_target || (github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')))) }} + if: ${{ always() && (inputs.deploy_target || (needs.build.result == 'success' && needs.lint.result == 'success' && github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')))) }}🤖 Prompt for AI Agents