Skip to content

Commit

Permalink
Merge pull request #6 from digital-society-coop/deploy-prod
Browse files Browse the repository at this point in the history
feat: Deploy prod
  • Loading branch information
ekadas authored Nov 6, 2024
2 parents a2f77c5 + 320cba6 commit 927c136
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/deploy-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
environment: dev

steps:
- uses: actions/checkout@v4
- run: ./deploy.sh dev
env:
AWS_REGION: ${{ vars.DEFAULT_DO_TERRAFORM_STATE_REGION }}
AWS_ENDPOINT_URL_S3: ${{ vars.DEFAULT_DO_TERRAFORM_STATE_ENDPOINT_URL_S3 }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
uses: ./.github/workflows/deploy.yaml
with:
environment: dev
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: deploy (prod)

on:
push:
branches: [prod]

jobs:
deploy:
uses: ./.github/workflows/deploy.yaml
with:
environment: prod
secrets: inherit
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: deploy

on:
workflow_call:
inputs:
environment:
description: The environment to target for the deployment
type: string
required: true
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true

env:
AWS_REGION: ${{ vars.DEFAULT_DO_TERRAFORM_STATE_REGION }}
AWS_ENDPOINT_URL_S3: ${{ vars.DEFAULT_DO_TERRAFORM_STATE_ENDPOINT_URL_S3 }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}

steps:
- uses: actions/checkout@v4
- run: ./deploy.sh ${{ inputs.environment }}
env:
AWS_REGION: ${{ env.AWS_REGION }}
AWS_ENDPOINT_URL_S3: ${{ env.AWS_ENDPOINT_URL_S3 }}
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}

0 comments on commit 927c136

Please sign in to comment.