diff --git a/.github/workflows/featureDeploy.yml b/.github/workflows/featureDeploy.yml deleted file mode 100644 index 7e77d25c8..000000000 --- a/.github/workflows/featureDeploy.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Deploy branch -run-name: Manual deploy to ${{ inputs.environment || 'development' }} by @${{ github.actor }} - -on: - workflow_dispatch: - inputs: - environment: - type: environment - description: The environment to deploy to. - -jobs: - detect-environments: - runs-on: ubuntu-latest - outputs: - environments: ${{ steps.environments.outputs.result }} - steps: - - uses: actions/github-script@v7 - id: environments - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - result-encoding: json - script: | - if (context.payload?.inputs?.environment) return [context.payload?.inputs?.environment]; - const {data: {environments}} = - await github.request(`GET /repos/${process.env.GITHUB_REPOSITORY}/environments`); - return environments.map(e => e.name) - - deploy-changes: - needs: [detect-environments] - strategy: - matrix: - environment: ${{ fromJSON(needs.detect-environments.outputs.environments) }} - if: ${{ inputs.environment != 'production' }} - uses: ./.github/workflows/deploy.yml - with: - environment: '${{ inputs.environment }}' - secrets: inherit - - diff --git a/.github/workflows/base.yml b/.github/workflows/publish.yml similarity index 76% rename from .github/workflows/base.yml rename to .github/workflows/publish.yml index 28b9937e7..241a20747 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,9 @@ -name: Code change pipeline -run-name: Code change pipeline to ${{ inputs.environment || 'development' }} by @${{ github.actor }} +name: Publish +run-name: Publish - ${{ github.head_ref || github.ref_name }} to ${{ inputs.environment || 'All' }} by @${{ github.actor }} triggered via ${{ github.event_name }} on: push: + branches: [main] workflow_dispatch: inputs: environment: @@ -32,15 +33,12 @@ jobs: await github.request(`GET /repos/${process.env.GITHUB_REPOSITORY}/environments`); return environments.map(e => e.name) - deploy-changes: + publish-image: needs: [run-tests, detect-environments] strategy: matrix: - environment: ['production', 'staging'] - if: ${{ github.ref_name == 'main'}} + environment: ${{ fromJSON(needs.detect-environments.outputs.environments) }} uses: ./.github/workflows/deploy.yml with: environment: '${{ matrix.environment }}' - secrets: inherit - - + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index bac50109e..c0dcefdbf 100755 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -1,4 +1,4 @@ -name: security-scan +name: Security Scan on: schedule: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff60c6639..1baf845a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,12 +1,11 @@ name: Test -run-name: Test run triggered by @${{ github.actor }} +run-name: Test - ${{ github.head_ref || github.ref_name }} by @${{ github.actor }} triggered via ${{ github.event_name }} on: workflow_call: inputs: environment: - description: What environment should the app be deployed to? - required: true + description: Which environment's containers to use for testing default: 'development' type: string secrets: @@ -16,11 +15,13 @@ on: required: true DEPLOY_AWS_SECRET_ACCESS_KEY: required: true + push: + branches-ignore: [main] jobs: test: runs-on: ubuntu-latest - environment: development + environment: ${{ inputs.environment || 'development' }} env: DOCKER_REPO: ${{ secrets.DEPLOY_DOCKER_REPOSITORY }} TESTCONTAINERS_REUSE_ENABLE: true