-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (53 loc) · 1.44 KB
/
docker-ci-serverless.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
name: Docker Build and Push Serverless
on:
push:
branches: [ "main" ]
paths:
- 'serverless/**'
- 'api/**'
- 'scripts/**'
- '.github/workflows/**'
pull_request:
branches: [ "main" ]
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
service:
- image-to-video
- text-to-image
- inpainting
- outpainting
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
file: serverless/${{ matrix.service }}/Dockerfile
push: true
tags: ${{secrets.DOCKER_USERNAME }}/picpilot_${{ matrix.service }}:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
notify:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Check build status
run: |
if [ "${{ needs.build-and-push.result }}" == "success" ]; then
echo "All images built and pushed successfully"
else
echo "Some builds failed, check the logs"
exit 1
fi