2023-11-14 02:32:16 +00:00
|
|
|
name: Publish Docker image (vue3 branch)
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'vue3'
|
|
|
|
|
2024-01-22 03:40:13 +00:00
|
|
|
env:
|
|
|
|
TAG: facilmap/facilmap:vue3
|
|
|
|
|
2023-11-14 02:32:16 +00:00
|
|
|
jobs:
|
|
|
|
push_to_registry:
|
|
|
|
name: Push Docker image to Docker Hub
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-01-22 03:40:13 +00:00
|
|
|
|
2023-11-14 02:32:16 +00:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
2024-01-22 03:40:13 +00:00
|
|
|
|
2023-11-14 02:32:16 +00:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
2024-01-22 03:40:13 +00:00
|
|
|
|
2023-11-14 02:32:16 +00:00
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2024-01-22 03:40:13 +00:00
|
|
|
|
2024-01-23 02:27:01 +00:00
|
|
|
-
|
|
|
|
name: Start integration test components in background
|
|
|
|
run: docker compose -f ./integration-tests/docker-compose.yml up -d --quiet-pull mysql postgres &
|
|
|
|
|
2023-11-14 02:32:16 +00:00
|
|
|
-
|
2024-01-22 03:40:13 +00:00
|
|
|
name: Build docker image
|
2023-11-14 02:32:16 +00:00
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
2024-01-22 03:40:13 +00:00
|
|
|
load: true
|
|
|
|
tags: |
|
|
|
|
${{env.TAG}}
|
|
|
|
facilmap-ci
|
|
|
|
|
|
|
|
-
|
|
|
|
name: Start integration test components
|
2024-01-23 02:27:01 +00:00
|
|
|
run: |
|
|
|
|
if ! docker compose -f ./integration-tests/docker-compose.yml up --wait; then
|
|
|
|
status="$?"
|
|
|
|
docker compose -f ./integration-tests/docker-compose.yml logs
|
|
|
|
exit "$status"
|
|
|
|
fi
|
2024-01-22 03:40:13 +00:00
|
|
|
|
|
|
|
-
|
|
|
|
name: Run integration tests
|
|
|
|
run: >-
|
|
|
|
docker run --rm -u root --add-host host.docker.internal:host-gateway facilmap-ci sh -c "
|
|
|
|
yarn workspaces focus facilmap-integration-tests &&
|
|
|
|
FACILMAP_URL=http://host.docker.internal:8080 yarn workspace facilmap-integration-tests run integration-tests &&
|
|
|
|
FACILMAP_URL=http://host.docker.internal:8081 yarn workspace facilmap-integration-tests run integration-tests
|
|
|
|
"
|
|
|
|
|
|
|
|
-
|
|
|
|
name: Push docker image
|
|
|
|
run: docker push "$TAG"
|