Skip to content

Commit

Permalink
tf
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff Kendal committed Feb 1, 2024
1 parent 61d2ded commit be8f7c3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 10 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,46 @@ jobs:
deploy-dev:
runs-on: ubuntu-latest
needs: build
environment: dev
permissions:
id-token: write
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::603042156394:role/_github_actions
aws-region: eu-west-1

- name: Terragrunt
uses: gruntwork-io/terragrunt-action@v2
with:
tf_version: ${{ env.terraform_version }}
tg_version: ${{ env.terragrunt_version }}
tg_dir: environments/dev
tg_command: 'apply'

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: accreditation
path: accreditation

- name: Copy to S3
run: aws s3 sync accreditation s3://stumblefunk-www-dev/accreditation

- name: Load env config
run: aws s3 cp s3://stumblefunk-www-dev/accreditation/config.js.env s3://stumblefunk-www-dev/accreditation/config.js


deploy-prod:
runs-on: ubuntu-latest
needs: [build, dev]
environment: prod
permissions:
id-token: write
contents: read
Expand Down
20 changes: 10 additions & 10 deletions terraform/api_gw.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ resource "aws_api_gateway_deployment" "this" {
rest_api_id = aws_api_gateway_rest_api.this.id
stage_name = var.environment
depends_on = [
aws_api_gateway_integration" "health_integration,
aws_api_gateway_integration" "group_get_integration,
aws_api_gateway_integration" "group_post_integration,
aws_api_gateway_integration" "group_patch_integration,
aws_api_gateway_integration" "group_delete_integration,
aws_api_gateway_integration" "groups_get_integration,
aws_api_gateway_integration" "ticket_post_integration,
aws_api_gateway_integration" "ticket_delete_integration,
aws_api_gateway_integration" "tickets_get_integration,
aws_api_gateway_integration" "login_post_integration
aws_api_gateway_integration.health_integration,
aws_api_gateway_integration.group_get_integration,
aws_api_gateway_integration.group_post_integration,
aws_api_gateway_integration.group_patch_integration,
aws_api_gateway_integration.group_delete_integration,
aws_api_gateway_integration.groups_get_integration,
aws_api_gateway_integration.ticket_post_integration,
aws_api_gateway_integration.ticket_delete_integration,
aws_api_gateway_integration.tickets_get_integration,
aws_api_gateway_integration.login_post_integration
]
}

Expand Down

0 comments on commit be8f7c3

Please sign in to comment.