Skip to content

Commit

Permalink
ci(GITHUB): workflow for tagged containers
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Nov 18, 2023
1 parent 3a5af18 commit fcf0b69
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/config/schemas/workflows/workflow-push.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"ci_extra_release_content": {
"description": "This controls the concurrency of each matrix instance in GitHub Actions.",
"type": "array",
"contains": {
"items": {
"type": "string"
}
},
Expand Down
5 changes: 1 addition & 4 deletions .github/config/workflows/workflow-push.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"ci_commit_spelling_rev_range": "HEAD",
"ci_commitizen_rev_range": "HEAD",
"ci_concurrency_limit": 4,
"ci_extra_release_content": [
"## Customizable Text.",
"This message is appended to the changelog of your GitHub release."
],
"ci_extra_release_content": [],
"ci_python_versions": ["3.9"],
"ci_trufflehog_extra_scan_args": "",
"ci_verbose_notifications": false
Expand Down
37 changes: 6 additions & 31 deletions .github/workflows/workflow-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ jobs:
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }}

scan_container_aws:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
permissions:
security-events: write
needs: [commit_lint, commit_spell_check, configuration, docker_container_lint, json_schema_lint, markdown_links, markdown_lint, markdown_spelling, pre-commit_hooks, security, shell_lint, start, toml_lint, workflow_lint, yaml_lint]
Expand All @@ -218,7 +217,6 @@ jobs:
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }}

scan_container_cloudflare:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
permissions:
security-events: write
needs: [commit_lint, commit_spell_check, configuration, docker_container_lint, json_schema_lint, markdown_links, markdown_lint, markdown_spelling, pre-commit_hooks, security, shell_lint, start, toml_lint, workflow_lint, yaml_lint]
Expand All @@ -233,8 +231,7 @@ jobs:
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }}

push_container_aws:
if: github.ref == 'refs/heads/master'
needs: [configuration, scan_container_aws]
needs: [scan_container_aws]
permissions:
packages: write
secrets:
Expand All @@ -246,13 +243,12 @@ jobs:
BUILD_ARGS: |
PROVIDER=aws
IMAGE_NAME: "docker.io/niallbyrne/smtp-aws"
IMAGE_LATEST: true
IMAGE_LATEST: ${{ github.ref == 'refs/heads/master' }}
REGISTRY: "docker.io"
VERBOSE_NOTIFICATIONS: true

push_container_cloudflare:
if: github.ref == 'refs/heads/master'
needs: [configuration, scan_container_cloudflare]
needs: [scan_container_cloudflare]
permissions:
packages: write
secrets:
Expand All @@ -264,7 +260,7 @@ jobs:
BUILD_ARGS: |
PROVIDER=cloudflare
IMAGE_NAME: "docker.io/niallbyrne/smtp-cloudflare"
IMAGE_LATEST: true
IMAGE_LATEST: ${{ github.ref == 'refs/heads/master' }}
REGISTRY: "docker.io"
VERBOSE_NOTIFICATIONS: true

Expand All @@ -278,29 +274,8 @@ jobs:
with:
JSON_APPENDED_CONTENT: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_extra_release_content) }}

success_master:
if: github.ref == 'refs/heads/master'
needs: [push_container_aws, push_container_cloudflare]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@master
with:
NOTIFICATION_EMOJI: ":checkered_flag:"
NOTIFICATION_MESSAGE: "Workflow has completed successfully!"

success_dev:
if: github.ref == 'refs/heads/dev'
needs: [scan_container_aws, scan_container_cloudflare]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@master
with:
NOTIFICATION_EMOJI: ":checkered_flag:"
NOTIFICATION_MESSAGE: "Workflow has completed successfully!"

success_other:
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev'
needs: [commit_lint, commit_spell_check, configuration, docker_container_lint, json_schema_lint, markdown_links, markdown_lint, markdown_spelling, pre-commit_hooks, security, shell_lint, start, toml_lint, workflow_lint, yaml_lint]
success:
needs: [create_release]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@master
Expand Down

0 comments on commit fcf0b69

Please sign in to comment.