This repository has been archived by the owner on Jan 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (48 loc) · 1.7 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Deploy
on:
push:
branches: main
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.CI_CD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CI_CD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build and push handler
uses: docker/build-push-action@v5
with:
context: .
push: true
file: dockerfile.handler
tags: ${{ steps.login-ecr.outputs.registry }}/wca-registration-handler:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push worker
uses: docker/build-push-action@v5
with:
context: .
push: true
file: dockerfile.worker
tags: ${{ steps.login-ecr.outputs.registry }}/wca-registration-worker:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy worker
run: |
aws ecs update-service --cluster wca-registration --service wca-registration-worker --force-new-deployment
- name: Deploy Frontend
run: |
cd ./Frontend
npm install
npm run build:prod
aws s3 sync dist s3://assets.registration.worldcubeassociation.org/dist
aws cloudfront create-invalidation --distribution-id E322K044MBR5FG --paths "/dist/*" --output text