-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.22 KB
/
main.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
name: Build and Deploy to AWS ECR
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
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: us-west-2
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v1
- name: Build, Tag, and Push Docker image to ECR
run: |
docker build -t hs-tic-tac-toe-net .
docker tag hs-tic-tac-toe-net 211125762589.dkr.ecr.us-west-2.amazonaws.com/hs-tic-tac-toe-net:latest
docker push 211125762589.dkr.ecr.us-west-2.amazonaws.com/hs-tic-tac-toe-net:latest
env:
AWS_DEFAULT_REGION: us-west-2
trigger-deploy:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Trigger Deployment
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: tim-br/counter_k8s
event-type: deploy-hs-tic-tac-toe-event