MAD-I-T / magento-actions

Github deployment actions for Magento 2
MIT License
101 stars 36 forks source link

[Feature] Control over builds that are kept on the server. #32

Closed Stevie-Ray closed 1 year ago

Stevie-Ray commented 1 year ago

As mentioned in #31, I was wondering if keep_releases in config/php-deployer/deploy.php can be converted to a variable. Now it is set to a default of three. It would improve the deploy actions if this was a setting, something like {{ deploy_keep_builds }} and can be set as an .env for example: KEEP_BUILDS which has a fallback to 3.

seyuf commented 1 year ago

@Stevie-Ray, Please feel free to test (through keep_releases ) and close this? The default value fo keep_releases is 3 if not specified. e.g:

- name: 'launch magento2 zero downtime deploy'
  if: always()
  uses: MAD-I-T/magento-actions@v3.15
  env:
    COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
    BUCKET_COMMIT: bucket-commit-${{github.sha}}.tar.gz
    MYSQL_ROOT_PASSWORD: magento
    MYSQL_DATABASE: magento
    HOST_DEPLOY_PATH: ${{secrets.STAGE_HOST_DEPLOY_PATH}}
    HOST_DEPLOY_PATH_BUCKET: ${{secrets.STAGE_HOST_DEPLOY_PATH}}/bucket
    SSH_PRIVATE_KEY: ${{secrets.STAGE_SSH_PRIVATE_KEY}}
    SSH_CONFIG: ${{secrets.STAGE_SSH_CONFIG}}
    WRITE_USE_SUDO: false
  with:
    deployer: 'no-permission-check'
    keep_releases: 2
    process: 'deploy-staging'