fix: ClosedWatchServiceException thrown routinely in FileAgentRegistr… #421
This file contains hidden or 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: deploy-docker | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| jobs: | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Extract branch name | |
| shell: bash | |
| run: | | |
| branch="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | |
| echo "branch=${branch##*/}" >> $GITHUB_OUTPUT | |
| id: extract_branch | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version and short SHA | |
| id: meta | |
| shell: bash | |
| run: | | |
| VERSION=$(grep -E "^version=" gradle.properties \ | |
| | head -n1 \ | |
| | cut -d'=' -f2 \ | |
| | cut -d'#' -f1 \ | |
| | tr -d '\r' \ | |
| | xargs) | |
| if [ -z "$VERSION" ]; then | |
| echo "Version not found in gradle.properties" >&2 | |
| exit 1 | |
| fi | |
| SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT | |
| - name: Determine build number | |
| id: buildnum | |
| shell: bash | |
| run: | | |
| git fetch --unshallow || true | |
| COUNT=$(git rev-list --count HEAD) | |
| echo "build_number=$COUNT" >> $GITHUB_OUTPUT | |
| - name: Log in to GHCR | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| continue-on-error: true | |
| with: | |
| registry: https://ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push to GHCR | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| continue-on-error: true | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/coral-protocol/coral-server:${{ steps.extract_branch.outputs.branch }} | |
| ${{ steps.extract_branch.outputs.branch == 'master' && 'ghcr.io/coral-protocol/coral-server:latest' || '' }} | |
| ghcr.io/coral-protocol/coral-server:${{ steps.meta.outputs.version }}-${{ steps.meta.outputs.short_sha }} | |
| ghcr.io/coral-protocol/coral-server:${{ steps.extract_branch.outputs.branch }}-${{ steps.buildnum.outputs.build_number }} | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| if: always() | |
| with: | |
| username: coralprotocol | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Build and push to Docker Hub | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| if: always() | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| coralprotocol/coral-server:${{ steps.extract_branch.outputs.branch }} | |
| ${{ steps.extract_branch.outputs.branch == 'master' && 'coralprotocol/coral-server:latest' || '' }} | |
| coralprotocol/coral-server:${{ steps.meta.outputs.version }}-${{ steps.meta.outputs.short_sha }} | |
| coralprotocol/coral-server:${{ steps.extract_branch.outputs.branch }}-${{ steps.buildnum.outputs.build_number }} |