check #6
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: Website — Docker Hub | |
| # Tag builds are handled by release-tauri.yml (installers + VitePress + optional Docker). | |
| # This workflow rebuilds the image when website sources change on the default branch. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - "website/**" | |
| - ".github/workflows/website-docker.yml" | |
| workflow_dispatch: | |
| env: | |
| IMAGE_NAME: aerosol-website | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Read website version | |
| id: webver | |
| run: echo "version=$(node -p "require('./website/package.json').version")" >> "$GITHUB_OUTPUT" | |
| - name: Write latest-release.json for download page | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| continue-on-error: true | |
| run: | | |
| gh api "repos/${{ github.repository }}/releases/latest" \ | |
| --jq '{tag_name: .tag_name, html_url: .html_url, published_at: .published_at, assets: [.assets[] | {name, browser_download_url, size}]}' \ | |
| > website/public/latest-release.json | |
| - name: Docker Hub login | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Image metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=semver,pattern={{version}} | |
| type=sha,prefix=commit- | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./website | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| VITE_GITHUB_REPO=${{ github.repository }} | |
| VITE_APP_VERSION=${{ steps.webver.outputs.version }} | |
| VITE_RELEASE_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} | |
| VITE_SITE_URL=${{ vars.WEBSITE_PUBLIC_URL || 'https://aerosol.januscaler.com' }} |