Skip to content

Commit

Permalink
Merge pull request #6 from wednesday-solutions/feat/update-ecs
Browse files Browse the repository at this point in the history
Feat/update ecs [skip actions]
  • Loading branch information
nikhilleo10 authored Nov 21, 2023
2 parents 4a3d2e2 + da19583 commit 0d1d770
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
### Ticket Link

---

### Related Links

---

### Description

---

### Steps to Reproduce / Test

---

---

### Checklist

- [ ] PR description included
- [ ] `yarn test` passes
- [ ] Tests are [changed or added]
- [ ] Relevant documentation is changed or added (and PR referenced)

### GIF's

---
42 changes: 42 additions & 0 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy -> Dev
on:
push:
branches:
- develop
jobs:
deploy:
name: Deploy to ECS
runs-on: ubuntu-latest
environment: development
permissions:
deployments: write
contents: read
actions: read
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Create GitHub Deployment
uses: chrnorm/deployment-action@v2
id: deployment
with:
token: '${{ github.token }}'
environment: development

- name: Checkout
uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Setup AWS Copilot
uses: softprops/setup-aws-copilot@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

- name: Deploy ECS
run: |
./scripts/update-ecs.sh ${{ env.ENVIRONMENT_NAME }}
42 changes: 42 additions & 0 deletions .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy -> Dev
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to ECS
runs-on: ubuntu-latest
environment: production
permissions:
deployments: write
contents: read
actions: read
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Create GitHub Deployment
uses: chrnorm/deployment-action@v2
id: deployment
with:
token: '${{ github.token }}'
environment: production

- name: Checkout
uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Setup AWS Copilot
uses: softprops/setup-aws-copilot@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

- name: Deploy ECS
run: |
./scripts/update-ecs.sh ${{ env.ENVIRONMENT_NAME }}
1 change: 1 addition & 0 deletions scripts/update-ecs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
copilot deploy --name "python-fastapi-template-$1-svc" -e $1

0 comments on commit 0d1d770

Please sign in to comment.