mirror of
https://github.com/standardnotes/server
synced 2026-04-19 08:02:23 -04:00
Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b4f1c6f7f8 | |||
| 14e4ca70b4 | |||
| 12fa94539b | |||
| e40a2459c0 | |||
| cffa6dc494 | |||
| d818799418 | |||
| 808d18e7cd | |||
| d40c4ac0ed | |||
| caaad9205c | |||
| 8a47c4bb41 | |||
| f7b3b9c4eb | |||
| 099430c764 | |||
| deca3ebd64 | |||
| 79dd3d02e3 | |||
| f49299fa91 | |||
| 250f408228 | |||
| 26f8b75bed | |||
| f541c2f7c1 | |||
| 997ffc02a3 | |||
| fa6335d6ac | |||
| 57694bdc14 | |||
| eed243d43b | |||
| 37e21f6505 | |||
| d25e14147c | |||
| 1d4bce7309 | |||
| 8c0c56930e | |||
| 2e9255344e | |||
| 346a7cabe1 | |||
| 4a430b2701 | |||
| bb53e88a4e | |||
| cfd04a5b39 | |||
| e0f2d5e202 | |||
| 3035cbc5de | |||
| 7c271be310 | |||
| ba373ebc6b | |||
| 2450d88a29 | |||
| 376a59c182 | |||
| d584ca57f1 | |||
| c50662849b | |||
| 82da690139 | |||
| b11a9b0eac | |||
| d7653474c3 | |||
| ce2fd86ca3 | |||
| c9c496c63f | |||
| b1c9f8ca6e | |||
| e84bd73a39 | |||
| c69d1b02fb | |||
| b590d33b88 | |||
| c1e7a3eb7e | |||
| fd743a9d5e | |||
| 4c40fd5186 | |||
| 2cb470b99e | |||
| b6539f8795 | |||
| 6d7de4a8da | |||
| 41999f36f0 | |||
| fa2a8da17b | |||
| 214684eae7 | |||
| b3a92af04d | |||
| 210a314c81 | |||
| 46cba52bcb | |||
| bf14ec05f9 | |||
| 6f88a96c3e | |||
| e12c9c47a7 | |||
| 83085052f8 | |||
| eda618d845 | |||
| 8d4280f4ca | |||
| b57816bba4 | |||
| b6db194a22 | |||
| 8f708164cd | |||
| ff09ae0a47 | |||
| d21d752029 | |||
| 2ea077a7cd | |||
| 0d67c55e12 | |||
| 8837dca039 | |||
| c9ec846a3c | |||
| 786829f317 | |||
| 10891af33b | |||
| 3f091175e2 | |||
| 0e5d7c918b | |||
| fd2358a4b8 | |||
| dd36b1859c | |||
| 8c9a8a484f | |||
| 451ed1ae3a | |||
| 4ec30df2dc | |||
| 163b7ff2d8 | |||
| 6e136e98b3 | |||
| 100eef2cb8 | |||
| 1d8cf4b675 | |||
| 5a01517097 | |||
| ca54d4e0a0 | |||
| 2bcc4a2254 | |||
| afe5ff3e70 | |||
| 4d8b021284 | |||
| 281dd3d378 | |||
| 7efb48dd2a | |||
| d7b68bcafb | |||
| 04d1dffe53 | |||
| db492c3787 | |||
| d04b04507a | |||
| 6c87d3614d | |||
| dd6d409ebb |
@@ -0,0 +1,6 @@
|
|||||||
|
DB_PORT=3306
|
||||||
|
DB_USERNAME=std_notes_user
|
||||||
|
DB_PASSWORD=changeme123
|
||||||
|
DB_DATABASE=standard_notes_db
|
||||||
|
|
||||||
|
REDIS_PORT=6379
|
||||||
+47
-32
@@ -1,14 +1,13 @@
|
|||||||
name: Api Gateway Dev
|
name: Api Gateway
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: api_gateway_dev_environment
|
group: api_gateway
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '@standardnotes/api-gateway@[0-9]*.[0-9]*.[0-9]*-alpha.[0-9]*'
|
- '*standardnotes/api-gateway*'
|
||||||
- '@standardnotes/api-gateway@[0-9]*.[0-9]*.[0-9]*-beta.[0-9]*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -17,9 +16,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v1
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
- run: yarn build
|
||||||
- run: yarn lint:api-gateway
|
- run: yarn lint:api-gateway
|
||||||
|
|
||||||
publish-aws-ecr:
|
publish-aws-ecr:
|
||||||
@@ -30,7 +32,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:api-gateway
|
run: yarn build
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
@@ -49,8 +51,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn docker build @standardnotes/api-gateway -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
yarn docker build @standardnotes/api-gateway -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
|
|
||||||
publish-docker-hub:
|
publish-docker-hub:
|
||||||
needs: test
|
needs: test
|
||||||
@@ -60,14 +62,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:api-gateway
|
run: yarn build
|
||||||
- name: Publish to Registry
|
- name: Login to Docker Hub
|
||||||
uses: elgohr/Publish-Docker-Github-Action@v4
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
name: standardnotes/api-gateway
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
tags: "dev,${{ github.sha }}"
|
- name: Build, tag, and push image to Docker Hub
|
||||||
|
run: |
|
||||||
|
yarn docker build @standardnotes/api-gateway -t standardnotes/api-gateway:${{ github.sha }}
|
||||||
|
docker push standardnotes/api-gateway:${{ github.sha }}
|
||||||
|
docker tag standardnotes/api-gateway:${{ github.sha }} standardnotes/api-gateway:latest
|
||||||
|
docker push standardnotes/api-gateway:latest
|
||||||
|
|
||||||
deploy-web:
|
deploy-web:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -81,26 +87,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition api-gateway-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition api-gateway-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="api-gateway-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="api-gateway-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: api-gateway-dev
|
container-name: api-gateway-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/api-gateway:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/api-gateway:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: api-gateway-dev
|
service: api-gateway-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition api-gateway-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="api-gateway-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: api-gateway-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/api-gateway:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: api-gateway-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
newrelic:
|
newrelic:
|
||||||
needs: deploy-web
|
needs: deploy-web
|
||||||
@@ -112,18 +138,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_API_GATEWAY_WEB_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_API_GATEWAY_WEB_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
|
|
||||||
notify_discord:
|
|
||||||
needs: deploy-web
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run Discord Webhook
|
|
||||||
uses: johnnyhuy/actions-discord-git-webhook@main
|
|
||||||
with:
|
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
name: Auth Server Dev
|
name: Auth Server
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: auth_dev_environment
|
group: auth
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '@standardnotes/auth-server@[0-9]*.[0-9]*.[0-9]*-alpha.[0-9]*'
|
- '*standardnotes/auth-server*'
|
||||||
- '@standardnotes/auth-server@[0-9]*.[0-9]*.[0-9]*-beta.[0-9]*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -17,9 +16,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v1
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
- run: yarn build
|
||||||
- run: yarn lint:auth
|
- run: yarn lint:auth
|
||||||
- run: yarn test:auth
|
- run: yarn test:auth
|
||||||
|
|
||||||
@@ -31,7 +33,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:auth
|
run: yarn build
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
@@ -50,8 +52,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn docker build @standardnotes/auth-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
yarn docker build @standardnotes/auth-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
|
|
||||||
publish-docker-hub:
|
publish-docker-hub:
|
||||||
needs: test
|
needs: test
|
||||||
@@ -61,7 +63,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:auth
|
run: yarn build
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -71,8 +73,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn docker build @standardnotes/auth-server -t standardnotes/auth:${{ github.sha }}
|
yarn docker build @standardnotes/auth-server -t standardnotes/auth:${{ github.sha }}
|
||||||
docker push standardnotes/auth:${{ github.sha }}
|
docker push standardnotes/auth:${{ github.sha }}
|
||||||
docker tag standardnotes/auth:${{ github.sha }} standardnotes/auth:dev
|
docker tag standardnotes/auth:${{ github.sha }} standardnotes/auth:latest
|
||||||
docker push standardnotes/auth:dev
|
docker push standardnotes/auth:latest
|
||||||
|
|
||||||
deploy-web:
|
deploy-web:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -86,26 +88,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition auth-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition auth-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="auth-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="auth-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: auth-dev
|
container-name: auth-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/auth:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/auth:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: auth-dev
|
service: auth-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition auth-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="auth-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: auth-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/auth:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: auth-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
deploy-worker:
|
deploy-worker:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -119,26 +141,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition auth-worker-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition auth-worker-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="auth-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="auth-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: auth-worker-dev
|
container-name: auth-worker-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/auth:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/auth:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: auth-worker-dev
|
service: auth-worker-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition auth-worker-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="auth-worker-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: auth-worker-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/auth:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: auth-worker-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
newrelic:
|
newrelic:
|
||||||
needs: [ deploy-web, deploy-worker ]
|
needs: [ deploy-web, deploy-worker ]
|
||||||
@@ -150,7 +192,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WEB_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WEB_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
@@ -159,19 +201,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WORKER_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WORKER_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
|
|
||||||
notify_discord:
|
|
||||||
needs: [ deploy-web, deploy-worker ]
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run Discord Webhook
|
|
||||||
uses: johnnyhuy/actions-discord-git-webhook@main
|
|
||||||
with:
|
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
||||||
|
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
name: Files Server Dev
|
name: Files Server
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: files_dev_environment
|
group: files
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '@standardnotes/files-server@[0-9]*.[0-9]*.[0-9]*-alpha.[0-9]*'
|
- '*standardnotes/files-server*'
|
||||||
- '@standardnotes/files-server@[0-9]*.[0-9]*.[0-9]*-beta.[0-9]*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -17,9 +16,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v1
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
- run: yarn build
|
||||||
- run: yarn lint:files
|
- run: yarn lint:files
|
||||||
- run: yarn test:files
|
- run: yarn test:files
|
||||||
|
|
||||||
@@ -31,7 +33,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:files
|
run: yarn build
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
@@ -50,8 +52,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn docker build @standardnotes/files-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
yarn docker build @standardnotes/files-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
|
|
||||||
publish-docker-hub:
|
publish-docker-hub:
|
||||||
needs: test
|
needs: test
|
||||||
@@ -61,14 +63,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:files
|
run: yarn build
|
||||||
- name: Publish to Registry
|
- name: Login to Docker Hub
|
||||||
uses: elgohr/Publish-Docker-Github-Action@v4
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
name: standardnotes/files
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
tags: "dev,${{ github.sha }}"
|
- name: Build, tag, and push image to Docker Hub
|
||||||
|
run: |
|
||||||
|
yarn docker build @standardnotes/files-server -t standardnotes/files:${{ github.sha }}
|
||||||
|
docker push standardnotes/files:${{ github.sha }}
|
||||||
|
docker tag standardnotes/files:${{ github.sha }} standardnotes/files:latest
|
||||||
|
docker push standardnotes/files:latest
|
||||||
|
|
||||||
deploy-web:
|
deploy-web:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -82,26 +88,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition files-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition files-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="files-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="files-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: files-dev
|
container-name: files-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/files:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/files:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: files-dev
|
service: files-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition files-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="files-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: files-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/files:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: files-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
deploy-worker:
|
deploy-worker:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -115,26 +141,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition files-worker-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition files-worker-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="files-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="files-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: files-worker-dev
|
container-name: files-worker-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/files:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/files:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: files-worker-dev
|
service: files-worker-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition files-worker-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="files-worker-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: files-worker-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/files:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: files-worker-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
newrelic:
|
newrelic:
|
||||||
needs: [ deploy-web, deploy-worker ]
|
needs: [ deploy-web, deploy-worker ]
|
||||||
@@ -146,7 +192,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WEB_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WEB_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
@@ -155,18 +201,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WORKER_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WORKER_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
|
|
||||||
notify_discord:
|
|
||||||
needs: [ deploy-web, deploy-worker ]
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run Discord Webhook
|
|
||||||
uses: johnnyhuy/actions-discord-git-webhook@main
|
|
||||||
with:
|
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: Pull Request
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: ESLint
|
||||||
|
run: yarn lint
|
||||||
|
- name: Build
|
||||||
|
run: yarn build
|
||||||
|
- name: Test
|
||||||
|
run: yarn test
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
name: Version Bump
|
name: Publish Packages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ develop, main ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bump:
|
release_and_publish:
|
||||||
if: contains(github.event.head_commit.message, 'chore(release)') == false
|
if: contains(github.event.head_commit.message, 'chore(release)') == false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -28,17 +28,20 @@ jobs:
|
|||||||
git_user_signingkey: true
|
git_user_signingkey: true
|
||||||
git_commit_gpgsign: true
|
git_commit_gpgsign: true
|
||||||
|
|
||||||
- uses: actions/setup-node@v1
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
- name: Install locally
|
- name: Build packages
|
||||||
run: yarn install --immutable
|
run: yarn build
|
||||||
|
|
||||||
- name: Bump Prod Version
|
- name: Bump version
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
run: yarn release
|
||||||
run: yarn release:prod
|
|
||||||
|
- name: Publish
|
||||||
|
run: yarn publish
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
|
||||||
|
|
||||||
- name: Bump Beta Version
|
|
||||||
if: ${{ github.ref == 'refs/heads/develop' }}
|
|
||||||
run: yarn release:beta
|
|
||||||
+41
-31
@@ -1,14 +1,13 @@
|
|||||||
name: Scheduler Server Dev
|
name: Scheduler Server
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: scheduler_dev_environment
|
group: scheduler
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '@standardnotes/scheduler-server@[0-9]*.[0-9]*.[0-9]*-alpha.[0-9]*'
|
- '*standardnotes/scheduler-server*'
|
||||||
- '@standardnotes/scheduler-server@[0-9]*.[0-9]*.[0-9]*-beta.[0-9]*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -17,9 +16,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v1
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
- run: yarn build
|
||||||
- run: yarn lint:scheduler
|
- run: yarn lint:scheduler
|
||||||
- run: yarn test:scheduler
|
- run: yarn test:scheduler
|
||||||
|
|
||||||
@@ -31,7 +33,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:scheduler
|
run: yarn build
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
@@ -50,8 +52,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn docker build @standardnotes/scheduler-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
yarn docker build @standardnotes/scheduler-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
|
|
||||||
publish-docker-hub:
|
publish-docker-hub:
|
||||||
needs: test
|
needs: test
|
||||||
@@ -61,7 +63,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:scheduler
|
run: yarn build
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -71,8 +73,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn docker build @standardnotes/scheduler-server -t standardnotes/scheduler:${{ github.sha }}
|
yarn docker build @standardnotes/scheduler-server -t standardnotes/scheduler:${{ github.sha }}
|
||||||
docker push standardnotes/scheduler:${{ github.sha }}
|
docker push standardnotes/scheduler:${{ github.sha }}
|
||||||
docker tag standardnotes/scheduler:${{ github.sha }} standardnotes/scheduler:dev
|
docker tag standardnotes/scheduler:${{ github.sha }} standardnotes/scheduler:latest
|
||||||
docker push standardnotes/scheduler:dev
|
docker push standardnotes/scheduler:latest
|
||||||
|
|
||||||
deploy-worker:
|
deploy-worker:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -86,26 +88,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition scheduler-worker-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition scheduler-worker-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="scheduler-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="scheduler-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: scheduler-worker-dev
|
container-name: scheduler-worker-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/scheduler-worker:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/scheduler-worker:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: scheduler-worker-dev
|
service: scheduler-worker-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition scheduler-worker-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="scheduler-worker-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: scheduler-worker-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/scheduler-worker:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: scheduler-worker-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
newrelic:
|
newrelic:
|
||||||
needs: [ deploy-worker ]
|
needs: [ deploy-worker ]
|
||||||
@@ -118,19 +140,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SCHEDULER_WORKER_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SCHEDULER_WORKER_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
|
|
||||||
notify_discord:
|
|
||||||
needs: [ deploy-worker ]
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run Discord Webhook
|
|
||||||
uses: johnnyhuy/actions-discord-git-webhook@main
|
|
||||||
with:
|
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
name: Update SNJS Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [snjs-updated-event]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
SNJSUpdateEvent:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
token: ${{ secrets.CI_PAT_TOKEN }}
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
- name: Setup git config
|
||||||
|
run: |
|
||||||
|
git config --global user.name "standardci"
|
||||||
|
git config --global user.email "ci@standardnotes.com"
|
||||||
|
- name: Import GPG key
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v4
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
|
git_user_signingkey: true
|
||||||
|
git_commit_gpgsign: true
|
||||||
|
|
||||||
|
- run: yarn install
|
||||||
|
- run: |
|
||||||
|
yarn upgrade:snjs
|
||||||
|
yarn install --no-immutable
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CI_PAT_TOKEN }}
|
||||||
|
title: "${{ 'chore(deps): upgrade snjs' }}"
|
||||||
|
body: Updates all packages prefixed with "@standardnotes/"
|
||||||
|
commit-message: "${{ 'chore(deps): upgrade snjs' }}"
|
||||||
|
delete-branch: true
|
||||||
|
committer: standardci <ci@standardnotes.com>
|
||||||
|
author: standardci <ci@standardnotes.com>
|
||||||
+74
-39
@@ -1,14 +1,13 @@
|
|||||||
name: Syncing Server Dev
|
name: Syncing Server
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: syncing_server_dev_environment
|
group: syncing_server
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '@standardnotes/syncing-server@[0-9]*.[0-9]*.[0-9]*-alpha.[0-9]*'
|
- '*standardnotes/syncing-server*'
|
||||||
- '@standardnotes/syncing-server@[0-9]*.[0-9]*.[0-9]*-beta.[0-9]*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -17,9 +16,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v1
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
- run: yarn build
|
||||||
- run: yarn lint:syncing-server
|
- run: yarn lint:syncing-server
|
||||||
- run: yarn test:syncing-server
|
- run: yarn test:syncing-server
|
||||||
|
|
||||||
@@ -31,7 +33,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:syncing-server
|
run: yarn build
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
@@ -50,8 +52,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn docker build @standardnotes/syncing-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
yarn docker build @standardnotes/syncing-server -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||||
|
|
||||||
publish-docker-hub:
|
publish-docker-hub:
|
||||||
needs: test
|
needs: test
|
||||||
@@ -61,14 +63,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build locally
|
- name: Build locally
|
||||||
run: yarn build:syncing-server
|
run: yarn build
|
||||||
- name: Publish to Registry
|
- name: Login to Docker Hub
|
||||||
uses: elgohr/Publish-Docker-Github-Action@v4
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
name: standardnotes/syncing-server-js
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
tags: "dev,${{ github.sha }}"
|
- name: Build, tag, and push image to Docker Hub
|
||||||
|
run: |
|
||||||
|
yarn docker build @standardnotes/syncing-server -t standardnotes/syncing-server-js:${{ github.sha }}
|
||||||
|
docker push standardnotes/syncing-server-js:${{ github.sha }}
|
||||||
|
docker tag standardnotes/syncing-server-js:${{ github.sha }} standardnotes/syncing-server-js:latest
|
||||||
|
docker push standardnotes/syncing-server-js:latest
|
||||||
|
|
||||||
deploy-web:
|
deploy-web:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -82,26 +88,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition syncing-server-js-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition syncing-server-js-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="syncing-server-js-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="syncing-server-js-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: syncing-server-js-dev
|
container-name: syncing-server-js-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/syncing-server-js:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/syncing-server-js:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: syncing-server-js-dev
|
service: syncing-server-js-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition syncing-server-js-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="syncing-server-js-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: syncing-server-js-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/syncing-server-js:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: syncing-server-js-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
deploy-worker:
|
deploy-worker:
|
||||||
needs: publish-aws-ecr
|
needs: publish-aws-ecr
|
||||||
@@ -115,26 +141,46 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: Download task definition
|
- name: DEV - Download task definition
|
||||||
run: |
|
run: |
|
||||||
aws ecs describe-task-definition --task-definition syncing-server-js-worker-dev --query taskDefinition > task-definition.json
|
aws ecs describe-task-definition --task-definition syncing-server-js-worker-dev --query taskDefinition > task-definition.json
|
||||||
- name: Fill in the new version in the Amazon ECS task definition
|
- name: DEV - Fill in the new version in the Amazon ECS task definition
|
||||||
run: |
|
run: |
|
||||||
jq '(.containerDefinitions[] | select(.name=="syncing-server-js-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
jq '(.containerDefinitions[] | select(.name=="syncing-server-js-worker-dev") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
- name: DEV - Fill in the new image ID in the Amazon ECS task definition
|
||||||
id: task-def
|
id: task-def-dev
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: task-definition.json
|
task-definition: task-definition.json
|
||||||
container-name: syncing-server-js-worker-dev
|
container-name: syncing-server-js-worker-dev
|
||||||
image: ${{ secrets.AWS_ECR_REGISTRY }}/syncing-server-js:${{ github.sha }}
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/syncing-server-js:${{ github.sha }}
|
||||||
- name: Deploy Amazon ECS task definition
|
- name: DEV - Deploy Amazon ECS task definition
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
with:
|
with:
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
task-definition: ${{ steps.task-def-dev.outputs.task-definition }}
|
||||||
service: syncing-server-js-worker-dev
|
service: syncing-server-js-worker-dev
|
||||||
cluster: dev
|
cluster: dev
|
||||||
wait-for-service-stability: true
|
wait-for-service-stability: true
|
||||||
|
- name: PROD - Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition syncing-server-js-worker-prod --query taskDefinition > task-definition.json
|
||||||
|
- name: PROD - Fill in the new version in the Amazon ECS task definition
|
||||||
|
run: |
|
||||||
|
jq '(.containerDefinitions[] | select(.name=="syncing-server-js-worker-prod") | .environment[] | select(.name=="VERSION")).value = "${{ github.sha }}"' task-definition.json > tmp.json && mv tmp.json task-definition.json
|
||||||
|
- name: PROD - Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def-prod
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: syncing-server-js-worker-prod
|
||||||
|
image: ${{ secrets.AWS_ECR_REGISTRY }}/syncing-server-js:${{ github.sha }}
|
||||||
|
- name: PROD - Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
|
||||||
|
service: syncing-server-js-worker-prod
|
||||||
|
cluster: prod
|
||||||
|
wait-for-service-stability: true
|
||||||
|
|
||||||
newrelic:
|
newrelic:
|
||||||
needs: [ deploy-web, deploy-worker ]
|
needs: [ deploy-web, deploy-worker ]
|
||||||
@@ -146,7 +192,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WEB_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WEB_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
@@ -155,18 +201,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WORKER_DEV }}
|
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WORKER_PROD }}
|
||||||
revision: "${{ github.sha }}"
|
revision: "${{ github.sha }}"
|
||||||
description: "Automated Deployment via Github Actions"
|
description: "Automated Deployment via Github Actions"
|
||||||
user: "${{ github.actor }}"
|
user: "${{ github.actor }}"
|
||||||
|
|
||||||
notify_discord:
|
|
||||||
needs: [ deploy-web, deploy-worker ]
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run Discord Webhook
|
|
||||||
uses: johnnyhuy/actions-discord-git-webhook@main
|
|
||||||
with:
|
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
||||||
+3
-1
@@ -1,7 +1,6 @@
|
|||||||
.eslintcache
|
.eslintcache
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
node_modules
|
|
||||||
dist
|
dist
|
||||||
coverage
|
coverage
|
||||||
.env
|
.env
|
||||||
@@ -18,3 +17,6 @@ newrelic_agent.log
|
|||||||
|
|
||||||
packages/files/uploads/*
|
packages/files/uploads/*
|
||||||
!packages/files/uploads/.gitkeep
|
!packages/files/uploads/.gitkeep
|
||||||
|
|
||||||
|
data/*
|
||||||
|
!data/.gitkeep
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user