Buckets:
| name: Docker Pre-release Build | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_suffix: | |
| description: 'Tag suffix for pre-release (e.g., alpha, beta, rc1)' | |
| required: false | |
| default: 'alpha' | |
| push_to_registry: | |
| description: 'Push to registry (true/false)' | |
| required: false | |
| default: 'true' | |
| jobs: | |
| docker-prerelease: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| - name: Log in to GitHub Container Registry | |
| if: github.event.inputs.push_to_registry != 'false' | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GHCR_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| run: | | |
| # Get version from package.json | |
| VERSION=$(node -p "require('./package.json').version") | |
| # Generate tag based on trigger | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| # Manual trigger - use provided suffix | |
| SUFFIX="${{ github.event.inputs.tag_suffix }}" | |
| TAG="${VERSION}-${SUFFIX}.$(date +%Y%m%d-%H%M%S)" | |
| else | |
| # Branch push - use branch name and commit | |
| BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/[^a-zA-Z0-9-]/-/g') | |
| SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7) | |
| TAG="${VERSION}-${BRANCH_NAME}.${SHORT_SHA}" | |
| fi | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| echo "docker_tag=ghcr.io/${{ github.repository }}:${TAG}" >> $GITHUB_OUTPUT | |
| echo "docker_tag_latest=ghcr.io/${{ github.repository }}:${BRANCH_NAME}-latest" >> $GITHUB_OUTPUT | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event.inputs.push_to_registry != 'false' }} | |
| tags: | | |
| ${{ steps.meta.outputs.docker_tag }} | |
| ${{ steps.meta.outputs.docker_tag_latest }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| BUILD_VERSION=${{ steps.meta.outputs.version }} | |
| BUILD_COMMIT=${{ github.sha }} | |
| BUILD_DATE=${{ github.event.repository.updated_at }} | |
| - name: Output image details | |
| run: | | |
| echo "### 🐳 Docker Pre-release Build Complete" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Version:** ${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Tag:** ${{ steps.meta.outputs.tag }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ github.event.inputs.push_to_registry }}" != "false" ]; then | |
| echo "**Images pushed to:**" >> $GITHUB_STEP_SUMMARY | |
| echo "- \`${{ steps.meta.outputs.docker_tag }}\`" >> $GITHUB_STEP_SUMMARY | |
| echo "- \`${{ steps.meta.outputs.docker_tag_latest }}\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Pull command:**" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY | |
| echo "docker pull ${{ steps.meta.outputs.docker_tag }}" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "**Note:** Image was built but not pushed to registry" >> $GITHUB_STEP_SUMMARY | |
| fi | |
Xet Storage Details
- Size:
- 3.87 kB
- Xet hash:
- 1b43f53dfa375a930e0374c99330bf752a865c9aec35633f887d7e78c1fa328a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.