Repository navigation
fix: make marketplace pagination visible #62
Workflow file for this run
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: Publish frontend image to GHCR | |
| # Build the Vue SPA and publish a multi-arch nginx image to GitHub Container | |
| # Registry, then (for v* tags only) cut a GitHub Release with the auto- | |
| # generated changelog and a `dist.tar.gz` static-asset bundle attached. | |
| # | |
| # Consumed by QuantDinger's docker-compose files as | |
| # ghcr.io/<owner>/quantdinger-frontend:<tag> | |
| # | |
| # Triggers: | |
| # - push of a version tag matching `v*` (e.g. v3.0.9) -> semver + latest | |
| # tags pushed AND a GitHub Release published | |
| # - manual workflow_dispatch -> short-SHA tag only, no Release | |
| # | |
| # First-time setup: after the first successful run, visit | |
| # https://github.com/orgs/<owner>/packages/container/quantdinger-frontend/settings | |
| # and set the package visibility to public if anonymous `docker pull` is desired. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| concurrency: | |
| group: release-frontend-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write # needed to create a GitHub Release | |
| packages: write # needed to push to GHCR | |
| jobs: | |
| publish: | |
| name: Build & push frontend image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Normalize GHCR image name | |
| id: image | |
| shell: bash | |
| run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/quantdinger-frontend" >> "$GITHUB_OUTPUT" | |
| - name: Extract image metadata | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ steps.image.outputs.name }} | |
| tags: | | |
| type=ref,event=tag | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | |
| type=sha,format=short | |
| - name: Build and push frontend | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=frontend | |
| cache-to: type=gha,mode=max,scope=frontend | |
| build-args: | | |
| APP_VERSION=${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }} | |
| GIT_TAG=${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }} | |
| provenance: false | |
| # ----- Release-only steps (skipped on workflow_dispatch) ----- | |
| - name: Extract dist tarball from just-pushed image | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| IMAGE: ${{ steps.image.outputs.name }}:${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| docker pull --platform linux/amd64 "$IMAGE" | |
| CID=$(docker create --platform linux/amd64 "$IMAGE") | |
| mkdir -p _dist | |
| docker cp "$CID:/usr/share/nginx/html/." _dist/ | |
| docker rm "$CID" > /dev/null | |
| tar -czf dist.tar.gz -C _dist . | |
| sha256sum dist.tar.gz | tee dist.tar.gz.sha256 | |
| du -h dist.tar.gz | |
| - name: Create or update GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| generate_release_notes: true | |
| append_body: true # preserve UI-authored notes; append our snippet | |
| files: | | |
| dist.tar.gz | |
| dist.tar.gz.sha256 | |
| body: | | |
| ## Frontend ${{ github.ref_name }} | |
| **Docker image (multi-arch, amd64 + arm64):** | |
| ```bash | |
| docker pull ${{ steps.image.outputs.name }}:${{ github.ref_name }} | |
| ``` | |
| Pinned in QuantDinger's `docker-compose.yml` via `IMAGE_TAG=${{ github.ref_name }}` in a project-root `.env`. | |
| **Static bundle:** `dist.tar.gz` — extract into any nginx/static host as `/usr/share/nginx/html/` (verify with `dist.tar.gz.sha256`). | |
| --- |