-
Notifications
You must be signed in to change notification settings - Fork 786
71 lines (62 loc) · 2.37 KB
/
build-docker-image.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build Docker Image and Push to ECR
on:
release:
types: [ published ]
env:
AWS_REGION: us-east-1
ECR_BACKEND_REPOSITORY: skyvern
ECR_UI_REPOSITORY: skyvern-ui
REGISTRY_ALIAS: skyvern # t6d4b5t4
jobs:
run-ci:
uses: ./.github/workflows/ci.yml
build-docker-image:
runs-on: ubuntu-latest
needs: [ run-ci ]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build, tag, and push backend image to Amazon Public ECR
id: build-image
uses: docker/build-push-action@v2
env:
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
with:
context: .
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.sha }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.event.release.tag_name }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:latest
- name: Build, tag, and push ui image to Amazon Public ECR
id: build-ui-image
uses: docker/build-push-action@v2
env:
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
with:
context: .
file: Dockerfile.ui
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:${{ github.sha }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:${{ github.event.release.tag_name }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:latest