Skip to content

Commit

Permalink
Test image auto-deployment (#95)
Browse files Browse the repository at this point in the history
Adds an option to auto-deploy the test image immediately to a desired environment.
  • Loading branch information
tonisojandu-sympower authored Dec 6, 2024
1 parent e249d6c commit 79e293f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/release-for-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,29 @@ jobs:
steps:
- id: setup-build-environment
name: "Setup build environment"
uses: sympower/sympower-composite-actions/setup-build-environment@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/setup-build-environment@2024.12.05.16.28-2d0b46c
with:
secrets: ${{ env.secrets }}
- id: format-version
name: "Format version"
uses: sympower/sympower-composite-actions/format-version@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/format-version@2024.12.05.16.28-2d0b46c
with:
style-as-release: ${{ env.IS_DEFAULT_BRANCH }}
- id: build-and-upload-docker-image
name: "Build and upload Docker Image"
uses: sympower/sympower-composite-actions/build-and-upload-docker-image@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/build-and-upload-docker-image@2024.12.05.16.28-2d0b46c
with:
version: ${{ steps.format-version.outputs.version }}
additional-gradle-args: ${{ inputs.additional-gradle-args }}
- id: upload-build-artifacts
name: "Upload build artifacts"
if: always()
uses: sympower/sympower-composite-actions/[email protected]
uses: sympower/sympower-composite-actions/[email protected]
- id: deploy-staging
name: "Deploy to testing environment"
uses: sympower/sympower-composite-actions/[email protected]
with:
secrets: ${{ env.secrets }}
version: ${{ steps.format-version.outputs.version }}
deploy-group: testing
require-approval: false
22 changes: 11 additions & 11 deletions .github/workflows/release-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ jobs:
steps:
- id: setup-build-environment
name: "Setup build environment"
uses: sympower/sympower-composite-actions/setup-build-environment@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/setup-build-environment@2024.12.05.16.28-2d0b46c
with:
secrets: ${{ env.secrets }}
- id: format-version
name: "Format version"
uses: sympower/sympower-composite-actions/format-version@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/format-version@2024.12.05.16.28-2d0b46c
with:
style-as-release: ${{ env.IS_DEFAULT_BRANCH }}
- id: run-tests
name: "Run tests"
uses: sympower/sympower-composite-actions/run-tests@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/run-tests@2024.12.05.16.28-2d0b46c
with:
additional-gradle-args: ${{ inputs.additional-gradle-args }}
- id: code-analysis
name: "Code analysis"
uses: sympower/sympower-composite-actions/code-analysis@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/code-analysis@2024.12.05.16.28-2d0b46c
with:
secrets: ${{ env.secrets }}
additional-gradle-args: ${{ inputs.additional-gradle-args }}
Expand All @@ -63,7 +63,7 @@ jobs:
- id: build-and-upload-docker-image
name: "Build and upload Docker Image"
if: env.IS_DEFAULT_BRANCH == 'true'
uses: sympower/sympower-composite-actions/build-and-upload-docker-image@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/build-and-upload-docker-image@2024.12.05.16.28-2d0b46c
with:
version: ${{ steps.format-version.outputs.version }}
additional-gradle-args: ${{ inputs.additional-gradle-args }}
Expand All @@ -83,7 +83,7 @@ jobs:
- id: upload-avro-schema
name: "Upload Avro schema"
if: env.IS_DEFAULT_BRANCH == 'true'
uses: sympower/sympower-composite-actions/upload-avro-schema@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/upload-avro-schema@2024.12.05.16.28-2d0b46c
with:
version: ${{ steps.format-version.outputs.version }}
secrets: ${{ env.secrets }}
Expand All @@ -92,7 +92,7 @@ jobs:
- id: upload-openapi-schema
name: "Upload OpenAPI schema"
if: env.IS_DEFAULT_BRANCH == 'true'
uses: sympower/sympower-composite-actions/upload-openapi-schema@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/upload-openapi-schema@2024.12.05.16.28-2d0b46c
with:
version: ${{ steps.format-version.outputs.version }}
secrets: ${{ env.secrets }}
Expand All @@ -101,13 +101,13 @@ jobs:
- id: upload-pacts
name: "Upload pacts"
if: env.IS_DEFAULT_BRANCH == 'true'
uses: sympower/sympower-composite-actions/upload-pacts@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/upload-pacts@2024.12.05.16.28-2d0b46c
with:
version: ${{ steps.format-version.outputs.version }}
- id: deploy-staging
name: "Deploy staging"
if: env.IS_DEFAULT_BRANCH == 'true'
uses: sympower/sympower-composite-actions/deploy-to-environment@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/deploy-to-environment@2024.12.05.16.28-2d0b46c
with:
secrets: ${{ env.secrets }}
version: ${{ steps.format-version.outputs.version }}
Expand All @@ -116,7 +116,7 @@ jobs:
- id: deploy-production
name: "Deploy production"
if: env.IS_DEFAULT_BRANCH == 'true'
uses: sympower/sympower-composite-actions/deploy-to-environment@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/deploy-to-environment@2024.12.05.16.28-2d0b46c
with:
secrets: ${{ env.secrets }}
version: ${{ steps.format-version.outputs.version }}
Expand All @@ -127,4 +127,4 @@ jobs:
- id: upload-build-artifacts
name: "Upload build artifacts"
if: always()
uses: sympower/sympower-composite-actions/upload-build-artifacts@2024.11.15.11.12-d7db6c0
uses: sympower/sympower-composite-actions/upload-build-artifacts@2024.12.05.16.28-2d0b46c
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ jobs:
schema artifact and Docker image without checking if the branch is main/master or not. This workflow is meant to be used
for manually publishing testing images and schemas.

If you have added [auto-deployment JSON](https://github.com/sympower/sympower-composite-actions/blob/main/README.md#deploy-to-environment)
with `testing` deployment group then this workflow will auto-deploy the created image to the desired environment.
For example following `auto-deploy/testing.env.json` file would deploy the image created to `my-test-env` environment:

```json
{
"environment": "my-test-env",
"deployGroup": "testing"
}
```

This workflow calls following composite actions:
* [setup-build-environment](https://github.com/sympower/sympower-composite-actions/blob/main/README.md#setup-build-environment)
* [format-version](https://github.com/sympower/sympower-composite-actions/blob/main/README.md#format-version)
Expand Down

0 comments on commit 79e293f

Please sign in to comment.