|  | 
|  | 1 | +#  Publishes the Diagnostics App Docker image to DockerHub | 
|  | 2 | +#  This is triggered whenever the `diagnostics-app` package is versioned and tagged | 
|  | 3 | +name: Diagnostics Image Release | 
|  | 4 | + | 
|  | 5 | +on: | 
|  | 6 | +  workflow_dispatch: | 
|  | 7 | +  push: | 
|  | 8 | +    tags: | 
|  | 9 | +      - '@powersync/diagnostics-app*' | 
|  | 10 | + | 
|  | 11 | +concurrency: ${{ github.workflow }}-${{ github.ref }} | 
|  | 12 | + | 
|  | 13 | +jobs: | 
|  | 14 | +  release-docker-image: | 
|  | 15 | +    name: Build and Release diagnostics-app Docker Image | 
|  | 16 | +    runs-on: ubuntu-latest | 
|  | 17 | +    if: github.ref == 'refs/heads/main' | 
|  | 18 | +    steps: | 
|  | 19 | +      - name: Checkout | 
|  | 20 | +        uses: actions/checkout@v4 | 
|  | 21 | + | 
|  | 22 | +      - name: Set up Docker Buildx | 
|  | 23 | +        uses: docker/setup-buildx-action@v3 | 
|  | 24 | + | 
|  | 25 | +      - name: Login to Docker Hub | 
|  | 26 | +        uses: docker/login-action@v3 | 
|  | 27 | +        with: | 
|  | 28 | +          username: ${{ secrets.DOCKERHUB_USERNAME }} | 
|  | 29 | +          password: ${{ secrets.DOCKERHUB_TOKEN }} | 
|  | 30 | + | 
|  | 31 | +        # This uses the service's package.json version for the Docker Image tag | 
|  | 32 | +      - name: Get Image Version from package.json | 
|  | 33 | +        id: get_version | 
|  | 34 | +        run: echo "IMAGE_VERSION=$(node -p "require('./tools/diagnostics-app/package.json').version")" >> $GITHUB_OUTPUT | 
|  | 35 | + | 
|  | 36 | +      - name: Build Image and Push | 
|  | 37 | +        uses: docker/build-push-action@v5 | 
|  | 38 | +        with: | 
|  | 39 | +          platforms: linux/amd64 | 
|  | 40 | +          cache-from: type=registry,ref=${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}:latest | 
|  | 41 | +          context: . | 
|  | 42 | +          tags: ${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}:latest,${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}:${{steps.get_version.outputs.IMAGE_VERSION}} | 
|  | 43 | +          push: true | 
|  | 44 | +          file: ./tools/diagnostics-app/Dockerfile | 
|  | 45 | + | 
|  | 46 | +      # Updates the README section on the DockerHub page | 
|  | 47 | +      - name: Update repo description | 
|  | 48 | +        #  Note that this 3rd party extention is recommended in the DockerHub docs: | 
|  | 49 | +        #  https://docs.docker.com/build/ci/github-actions/update-dockerhub-desc/ | 
|  | 50 | +        uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4.0.0 | 
|  | 51 | +        with: | 
|  | 52 | +          username: ${{ secrets.DOCKERHUB_USERNAME }} | 
|  | 53 | +          password: ${{ secrets.DOCKERHUB_TOKEN }} | 
|  | 54 | +          repository: ${{vars.DIAGNOSTICS_DOCKER_REGISTRY}} | 
|  | 55 | +          #   This is the contents of what will be shown on DockerHub | 
|  | 56 | +          readme-filepath: ./tools/diagnostics-app/README.md | 
0 commit comments