Skip to content

Commit

Permalink
OPHLUDOS-205-1: add deploy prod
Browse files Browse the repository at this point in the history
  • Loading branch information
horttanainen committed Aug 21, 2024
1 parent c04e061 commit d263c82
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy Prod

on:
workflow_dispatch:
inputs:
branch:
description: Branch to deploy
required: false
default: green-qa

concurrency: deploy-prod

env:
DOCKER_BUILDKIT: '1' # BuildKit is enabled by default starting in Docker v23, Ubuntu 22.04 has an older version

defaults:
run:
shell: bash

jobs:
deploy_prod:
name: 09-deploy-prod.sh
permissions:
packages: read
id-token: write
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4.1.6

- name: Send build status "in progress"
uses: ./.github/actions/build_status
with:
task: deploy-prod
status: inProgress
api_key: ${{ secrets.RADIATOR_AUTH_TOKEN }}
- name: Fetch history for all branches and tags
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure prod AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::072794607950:role/ludos-github-actions-role-prod
aws-region: eu-west-1
- name: Deploy Prod
run: ./deploy-scripts/09-deploy-prod.sh

- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag --force green-prod
git push --force origin green-prod

deployment_status_completed:
name: Send deployment status
needs: [deploy_prod]
if: always()
continue-on-error: true
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4.1.6
- uses: ./.github/actions/build_status
with:
task: deploy-prod
status: ${{ needs.deploy_prod.result == 'success' && 'success' || 'failure' }}
api_key: ${{ secrets.RADIATOR_AUTH_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ jobs:
- name: Deploy Qa
run: ./deploy-scripts/08-deploy-qa.sh

- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag --force green-qa
git push --force origin green-qa

deployment_status_completed:
name: Send deployment status
needs: [deploy_qa]
Expand Down

0 comments on commit d263c82

Please sign in to comment.