-
-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add beta deployment on feature branches
- Loading branch information
Karol Sójko
committed
Dec 15, 2021
1 parent
c59f85f
commit 46e8348
Showing
3 changed files
with
80 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Dev | ||
|
||
on: | ||
push: | ||
branches: [ feature/* ] | ||
|
||
jobs: | ||
tsc: | ||
name: Check types & lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: yarn install --pure-lockfile | ||
- name: Typescript | ||
run: yarn tsc | ||
- name: ESLint | ||
run: yarn lint --quiet | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: tsc | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Copy robots.txt | ||
run: cp public/robots.txt.development public/robots.txt | ||
- name: Publish to Registry | ||
uses: elgohr/Publish-Docker-Github-Action@master | ||
with: | ||
name: standardnotes/web | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
tags: "beta,${{ github.sha }}" | ||
- 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: us-east-1 | ||
- name: Download task definition | ||
run: | | ||
aws ecs describe-task-definition --task-definition app-beta-dev --query taskDefinition > task-definition.json | ||
- name: Fill in the new image ID in the Amazon ECS task definition | ||
id: task-def | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: task-definition.json | ||
container-name: app-beta-dev | ||
image: "standardnotes/web:${{ github.sha }}" | ||
|
||
- name: Deploy Amazon ECS task definition | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
with: | ||
task-definition: ${{ steps.task-def.outputs.task-definition }} | ||
service: app-beta-dev | ||
cluster: dev | ||
wait-for-service-stability: true | ||
|
||
notify_discord: | ||
needs: deploy | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Run Discord Webhook | ||
uses: johnnyhuy/actions-discord-git-webhook@main | ||
with: | ||
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }} |
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
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