adds health check #6
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: Package (pre-release) | |
env: | |
GITHUB_SHA: ${{ github.sha }} | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}/vospace | |
on: | |
push: | |
# branches: | |
# - main | |
# - 'hotfix-*' | |
jobs: | |
package-docker: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Init - register short hash | |
run: echo SHA_SHORT="${GITHUB_SHA::7}" >> $GITHUB_ENV | |
- name: Init - register image tag | |
run: echo IMAGE_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.SHA_SHORT }}" >> $GITHUB_ENV | |
- name: Build - build local ANT image | |
run: docker build -f Dockerfile.ApacheAnt -t apache-ant . | |
- name: Build - create VOSpace Java build with ANT | |
run: docker run --rm -v ./java:/app apache-ant dist | |
- name: Package - build VOSpace image | |
run: docker build --file Dockerfile --tag ${{ env.IMAGE_TAG }} . | |
- name: Test - Start VOSpace container | |
run: | | |
docker run -d \ | |
--env-file .env.example \ | |
--name vospace-example \ | |
--publish 3001:8080/tcp \ | |
${{ env.IMAGE_TAG }} | |
- name: Test - perform health checks | |
run: | | |
curl \ | |
--fail \ | |
--connect-timeout 10 \ | |
--retry 3 \ | |
--retry-delay 5 \ | |
--retry-max-time 40 \ | |
--retry-all-errors \ | |
-o /dev/null \ | |
http://localhost:3001/vospace-2.0/vospace/ | |
- name: Publish - Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish - Push the new tag | |
run: docker push ${{ env.IMAGE_TAG }} |