File tree Expand file tree Collapse file tree 3 files changed +39
-2
lines changed
Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to production
2+
3+ on :
4+ push :
5+ branches : ['master']
6+
7+ jobs :
8+ build :
9+ name : Build image
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout repo
14+ uses : actions/checkout@v3
15+
16+ - name : Configure AWS credentials
17+ uses : aws-actions/configure-aws-credentials@v1
18+ with :
19+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
20+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21+ aws-region : ap-southeast-1
22+
23+ - name : Login to Amazon ECR
24+ id : login-ecr
25+ uses : aws-actions/amazon-ecr-login@v1
26+
27+ - name : Build, tag, and push image to Amazon ECR
28+ env :
29+ ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
30+ ECR_REPOSITORY : tinybank
31+ IMAGE_TAG : ${{ github.sha }}
32+ run : |
33+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
34+ docker push -a $ECR_REGISTRY/$ECR_REPOSITORY
Original file line number Diff line number Diff line change 11# This workflow will build a golang project
22# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
33
4- name : ci-test
4+ name : Run unit tests
55
66on :
77 push :
Original file line number Diff line number Diff line change 11{
2- "docwriter.style" : " Auto-detect"
2+ "docwriter.style" : " Auto-detect" ,
3+ "yaml.schemas" : {
4+ "https://json.schemastore.org/github-workflow.json" : " file:///home/mars/Minh%27sLand/tinybank/.github/workflows/deploy.yml"
5+ }
36}
You can’t perform that action at this time.
0 commit comments