Do not deploy to staging when merge to master #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Review and deploy" | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- deploy_to_staging | |
- deploy_to_clients | |
- deploy_to_production | |
concurrency: | |
group: ${{ github.head_ref || github.ref }} | |
cancel-in-progress: false | |
jobs: | |
target_name: | |
runs-on: ubuntu-latest | |
outputs: | |
name: ${{steps.branch_name.outputs.current_branch}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get branch name | |
id: branch_name | |
uses: tj-actions/branch-names@v7.0.7 | |
staging: | |
uses: ./.github/workflows/deploy.yml | |
needs: | |
- target_name | |
if: ${{needs.target_name.outputs.name == 'deploy_to_staging'}} | |
with: | |
AWS_REGION: eu-west-1 | |
ENVIRONMENT: "staging" | |
PRODUCT: "idos" | |
PROJECT: "kwil" | |
secrets: | |
AWS_ACCESS_KEY_ID: ${{secrets.STAGING_AWS_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.STAGING_AWS_SECRET_ACCESS_KEY}} | |
SLACK_BOT_TOKEN: ${{secrets.SLACK_BOT_TOKEN}} | |
DOCKER_HUB_USERNAME: ${{secrets.DOCKER_HUB_USERNAME}} | |
DOCKER_HUB_PASSWORD: ${{secrets.DOCKER_HUB_PASSWORD}} | |
clients: | |
uses: ./.github/workflows/deploy.yml | |
needs: | |
- target_name | |
if: ${{false}} # Temporarily disabled | |
with: | |
AWS_REGION: eu-west-1 | |
ENVIRONMENT: "clients" | |
PRODUCT: "idos" | |
PROJECT: "kwil" | |
secrets: | |
AWS_ACCESS_KEY_ID: ${{secrets.STAGING_AWS_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.STAGING_AWS_SECRET_ACCESS_KEY}} | |
SLACK_BOT_TOKEN: ${{secrets.SLACK_BOT_TOKEN}} | |
DOCKER_HUB_USERNAME: ${{secrets.DOCKER_HUB_USERNAME}} | |
DOCKER_HUB_PASSWORD: ${{secrets.DOCKER_HUB_PASSWORD}} | |
production: | |
uses: ./.github/workflows/deploy.yml | |
needs: | |
- target_name | |
if: ${{false}} # Temporarily disabled | |
with: | |
AWS_REGION: eu-west-1 | |
ENVIRONMENT: "production" | |
PRODUCT: "idos" | |
PROJECT: "kwil" | |
secrets: | |
AWS_ACCESS_KEY_ID: ${{secrets.PRODUCTION_AWS_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY}} | |
SLACK_BOT_TOKEN: ${{secrets.SLACK_BOT_TOKEN}} | |
DOCKER_HUB_USERNAME: ${{secrets.DOCKER_HUB_USERNAME}} | |
DOCKER_HUB_PASSWORD: ${{secrets.DOCKER_HUB_PASSWORD}} |