# Builds and publishes the temetro Docker images and cuts a GitHub Release. # # Trigger: push a semver tag, e.g. # git tag v0.1.0 && git push origin v0.1.0 # # The frontend image bakes NO API URL — it resolves the backend from the host # the browser uses at runtime — so one published image works for every clinic. # # Required repository secrets (Settings → Secrets and variables → Actions): # DOCKERHUB_USERNAME — the Docker Hub account `khalidxv` (or one with push # access to that namespace) # DOCKERHUB_TOKEN — a Docker Hub access token for that account # Without them the build/login step fails; the workflow is otherwise inert. name: release on: push: tags: - "v*.*.*" permissions: contents: write # create the GitHub Release (the update check reads this) env: REGISTRY_NAMESPACE: khalidxv jobs: publish: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Derive version from tag id: meta run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" - name: Set up Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build & push backend uses: docker/build-push-action@v6 with: context: ./backend push: true tags: | ${{ env.REGISTRY_NAMESPACE }}/temetro-backend:${{ steps.meta.outputs.version }} ${{ env.REGISTRY_NAMESPACE }}/temetro-backend:latest - name: Build & push frontend uses: docker/build-push-action@v6 with: context: ./frontend push: true tags: | ${{ env.REGISTRY_NAMESPACE }}/temetro-frontend:${{ steps.meta.outputs.version }} ${{ env.REGISTRY_NAMESPACE }}/temetro-frontend:latest - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: generate_release_notes: true