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 ee09cf5 commit 8682c6f
Showing 1 changed file with 37 additions and 20 deletions.
57 changes: 37 additions & 20 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,11 @@ jobs:
BUILD_ARGS: |
PROVIDER=aws
IMAGE_NAME: "docker.io/niallbyrne/smtp-aws"
IMAGE_LATEST: true
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 +259,6 @@ jobs:
BUILD_ARGS: |
PROVIDER=cloudflare
IMAGE_NAME: "docker.io/niallbyrne/smtp-cloudflare"
IMAGE_LATEST: true
REGISTRY: "docker.io"
VERBOSE_NOTIFICATIONS: true

Expand All @@ -278,29 +272,52 @@ 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]
release_container_aws:
needs: [create_release]
permissions:
packages: write
secrets:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@master
uses: cicd-tools-org/cicd-tools/.github/workflows/job-99-container-push_release.yml@master
with:
NOTIFICATION_EMOJI: ":checkered_flag:"
NOTIFICATION_MESSAGE: "Workflow has completed successfully!"
BUILD_ARGS: |
PROVIDER=aws
IMAGE_NAME: "docker.io/niallbyrne/smtp-aws"
IMAGE_LATEST: true
REGISTRY: "docker.io"
VERBOSE_NOTIFICATIONS: true

success_dev:
if: github.ref == 'refs/heads/dev'
needs: [scan_container_aws, scan_container_cloudflare]
release_container_cloudflare:
needs: [create_release]
permissions:
packages: write
secrets:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-99-container-push_release.yml@master
with:
BUILD_ARGS: |
PROVIDER=cloudflare
IMAGE_NAME: "docker.io/niallbyrne/smtp-cloudflare"
IMAGE_LATEST: true
REGISTRY: "docker.io"
VERBOSE_NOTIFICATIONS: true

success_branches:
if: contains(github.ref, 'refs/heads')
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_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_tags:
needs: [release_container_aws, release_container_cloudflare]
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 8682c6f

Please sign in to comment.