Build docker compose dev environment #1833
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |