-
Notifications
You must be signed in to change notification settings - Fork 158
feat(docker): add optional full-stack image #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+748
−36
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
61ad140
feat(docker): add optional full-stack image
1615a56
ci: validate full-stack image on pull requests
d6b07d5
docs: add Chinese full-stack Docker guide
b052f4f
fix(ci): align image releases and harden full-stack deployment
e4ad65e
fix(release): standardize image roles and version contract
bc73b7e
fix(docs): harden full-stack migration guidance
a6ef2b3
fix(docs): preserve credentials during full-stack migration
f1f0a2c
fix(release): block invalid desktop releases
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| name: Publish Full-Stack Docker Image to GHCR | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: ['v*'] | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'Dockerfile.fullstack' | ||
| - 'Dockerfile.fullstack.dockerignore' | ||
| - 'docker-compose.fullstack.yml' | ||
| - '.github/workflows/docker-publish-fullstack.yml' | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
| - 'src/**' | ||
| - 'public/**' | ||
| - 'vite.config.ts' | ||
| - 'nginx.conf.template' | ||
| - 'server/**' | ||
| workflow_dispatch: | ||
|
|
||
| # A semver publication updates shared tags (for example 1 and 1.2), so tag | ||
| # releases use one group. Branches and pull requests remain independent. | ||
| concurrency: | ||
| group: fullstack-image-${{ github.ref_type == 'tag' && 'release' || github.ref }} | ||
| # Keep the newest branch/PR build, but finish every release tag in order so | ||
| # shared major/minor tags cannot race or leave an older version unpublished. | ||
| cancel-in-progress: ${{ github.ref_type != 'tag' }} | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ${{ github.repository_owner }}/github-stars-manager-fullstack | ||
|
|
||
| jobs: | ||
| validate: | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| # PR validation does not authenticate to GHCR and cannot publish packages. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | ||
|
|
||
| - name: Validate full-stack multi-architecture image | ||
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile.fullstack | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: false | ||
| # The cache remains isolated from the frontend and backend image workflows. | ||
| cache-from: type=gha,scope=github-stars-manager-fullstack-pr,timeout=5m | ||
| cache-to: type=gha,scope=github-stars-manager-fullstack-pr,mode=max,timeout=5m,ignore-error=true | ||
|
|
||
| publish: | ||
| if: github.event_name != 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| # A cache or registry outage must not leave a publishing run blocked forever. | ||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Verify release tag matches client version | ||
| if: github.ref_type == 'tag' | ||
| run: node scripts/check-release-version.cjs "$GITHUB_REF_NAME" | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata (tags, labels) | ||
| id: meta | ||
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| # branch push → "latest" | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| # tag push → "v1.2.3", "1.2.3", "1.2", "1" | ||
| type=ref,event=tag | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=semver,pattern={{major}} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| # every build → sha-abc1234 | ||
| type=sha,prefix=sha- | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile.fullstack | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| # Keep this cache independent from frontend and server image builds. | ||
| cache-from: type=gha,scope=github-stars-manager-fullstack-publish-${{ github.ref_type }},timeout=5m | ||
| cache-to: type=gha,scope=github-stars-manager-fullstack-publish-${{ github.ref_type }},mode=max,timeout=5m,ignore-error=true | ||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.