-
Notifications
You must be signed in to change notification settings - Fork 39
49 lines (43 loc) · 1.41 KB
/
dockercompose.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
name: Build docker compose dev environment
on:
schedule:
- cron: '6 6 * * *'
push:
pull_request:
jobs:
build-docker-compose:
name: "Build docker-compose-based development environment"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: docker compose build
run: |
echo "UID=$(id -u)" >> .env
echo "GID=$(id -g)" >> .env
docker compose build
- name: Verify containers stay running at least 1 minute
run: |
docker compose up -d
sleep 60
docker compose ps
echo "Verifying service states"
docker compose ps -q | xargs docker inspect -f '{{.State.Running}}' | grep -q false && exit 1
echo "Looks ok"
- name: Print docker compose logs
if: failure()
run: |
docker compose logs
- name: Send GitHub Action trigger data to Slack workflow
id: slack
if: failure()
uses: slackapi/[email protected]
with:
payload: |
{
"title": "Building NAV's Docker Compose dev environment failed",
"github_ref_name": "${{ github.ref_name }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger