-
Notifications
You must be signed in to change notification settings - Fork 117
45 lines (38 loc) · 1.35 KB
/
ecr-publish.yml
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
on:
push:
branches:
- master
jobs:
build_push_sample_app_image:
name: Build and Push Sample App docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create a directory
run: mkdir sample-apps/http-server/aws-xray-sdk-go
- name: Copy X-Ray SDK to deployment package with Sample App
run: rsync -r * sample-apps/http-server/aws-xray-sdk-go --exclude sample-apps/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layer
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
aws-region: us-east-1
- name: Login to Public ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
- name: Build image and push to ECR
uses: docker/build-push-action@v2
with:
file: sample-apps/http-server/Dockerfile
context: .
tags: public.ecr.aws/s6b4x8l3/aws-xray-go-sdk-sample-app:${{ github.sha }}
push: true