-
Notifications
You must be signed in to change notification settings - Fork 4
41 lines (41 loc) · 1.22 KB
/
build.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
name: Build Images and Deploy
on:
push:
branches:
- staging
env:
DOCKER_VERSION: 20.10.14
DEPLOYMENT_WEBHOOK: ${{ secrets.DEPLOYMENT_WEBHOOK }}
jobs:
build-and-push-image:
name: Build And Push ${{ matrix.target }} Image
runs-on: ubuntu-latest
strategy:
matrix:
target: [react-app, graphql-server, bdjuno]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to ghcr.io
run: |-
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u oursky --password-stdin
- name: Build Images
run: make docker-build-${{matrix.target}}
- name: Push Images
run: make docker-push-${{matrix.target}}
invoke-deployment-webhook:
name: Invoke Deployment Webhook
runs-on: ubuntu-latest
needs:
- build-and-push-image
steps:
- if: "${{ env.DEPLOYMENT_WEBHOOK != '' }}"
run: |
curl -H "Authorization: Bearer ${{ secrets.DEPLOYMENT_WEBHOOK_KEY }}" \
--request POST \
--data '{"event_type": "deployment", "client_payload": {"branch": "${{ github.ref_name }}"}}' \
$DEPLOYMENT_WEBHOOK