-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 2.14 KB
/
build-and-deploy.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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Deploy Stack
on:
push:
branches:
- "flyio"
workflow_dispatch:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
test-api:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Test api
working-directory: ./catchemall/web-api
run: ./test.sh
build-push-api:
needs: test-api
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Log in to registry
uses: docker/login-action@v2
with:
username: ${{ secrets.CONTAINER_USERNAME }}
password: ${{ secrets.CONTAINER_PASSWORD }}
- name: Web Api - Build and Push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ secrets.REPOSITORY_NAME }}/catchemall-api:${{ github.sha }}, ${{ secrets.REPOSITORY_NAME }}/catchemall-api
context: ./catchemall/web-api
file: ./catchemall/web-api/Dockerfile
build-push-ui:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Log in to registry
uses: docker/login-action@v2
with:
username: ${{ secrets.CONTAINER_USERNAME }}
password: ${{ secrets.CONTAINER_PASSWORD }}
- name: UI - Build and Push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ secrets.REPOSITORY_NAME }}/catchemall-ui:${{ github.sha }}, ${{ secrets.REPOSITORY_NAME }}/catchemall-ui
context: ./catchemall/ui
file: ./catchemall/ui/Dockerfile
deploy:
needs: [build-push-api, build-push-ui]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: deploy ui
run: flyctl deploy --image ${{ secrets.REPOSITORY_NAME }}/catchemall-ui:${{ github.sha }} --remote-only catchemall/ui
- name: deploy webapi
run: flyctl deploy --image ${{ secrets.REPOSITORY_NAME }}/catchemall-api:${{ github.sha }} --remote-only catchemall/web-api