-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (43 loc) · 1.34 KB
/
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
46
47
48
name: Publish to Docker Hub
on:
workflow_dispatch:
workflow_run:
branches:
- master
workflows:
- Unit tests
types:
- completed
jobs:
publish:
runs-on: ubuntu-latest
name: Publish docker image
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login AWS
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::724178030834:role/capplatform-deploy
aws-access-key-id: ${{ secrets.CAPPLATFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CAPPLATFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login AWS ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: |
mergermarket/cdflow2-build-docker-ecr:latest
public.ecr.aws/p7e3d1i3/cdflow2-build-docker-ecr:latest