diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/docker-backend.yml | 32 | ||||
| -rw-r--r-- | .github/workflows/docker-frontend.yml | 2 |
2 files changed, 33 insertions, 1 deletions
diff --git a/.github/workflows/docker-backend.yml b/.github/workflows/docker-backend.yml new file mode 100644 index 0000000..f355e65 --- /dev/null +++ b/.github/workflows/docker-backend.yml @@ -0,0 +1,32 @@ +name: Deploy backend to AWS + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - 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: eu-west-1 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Build & push backend Docker image + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: tetris + IMAGE_TAG: backend + run: | + cd backend + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG diff --git a/.github/workflows/docker-frontend.yml b/.github/workflows/docker-frontend.yml index 17b84c0..2a0bbd6 100644 --- a/.github/workflows/docker-frontend.yml +++ b/.github/workflows/docker-frontend.yml @@ -1,4 +1,4 @@ -name: AWS Deployment +name: Deploy frontend to AWS on: workflow_dispatch: |
