Merge pull request #374 from Dstack-TEE/rm-docker-cfg #4
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
| # SPDX-FileCopyrightText: © 2025 Phala Network <[email protected]> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Gateway Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'gateway-v*' | |
| permissions: | |
| attestations: write | |
| id-token: write | |
| contents: write | |
| packages: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Parse version from tag | |
| run: | | |
| # Extract version from tag (e.g., gateway-v1.2.3 -> 1.2.3) | |
| VERSION=${GITHUB_REF#refs/tags/gateway-v} | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "Parsed version: $VERSION" | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get Git commit timestamps | |
| run: | | |
| echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV | |
| echo "GIT_REV=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
| - name: Build and push Docker image | |
| id: build-and-push | |
| uses: docker/build-push-action@v5 | |
| env: | |
| SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }} | |
| with: | |
| context: gateway/dstack-app/builder | |
| push: true | |
| tags: ${{ vars.DOCKERHUB_ORG }}/dstack-gateway:${{ env.VERSION }} | |
| platforms: linux/amd64 | |
| provenance: false | |
| build-args: | | |
| DSTACK_REV=${{ env.GIT_REV }} | |
| SOURCE_DATE_EPOCH=${{ env.TIMESTAMP }} | |
| - name: Generate artifact attestation | |
| uses: actions/attest-build-provenance@v1 | |
| with: | |
| subject-name: "docker.io/${{ vars.DOCKERHUB_ORG }}/dstack-gateway" | |
| subject-digest: ${{ steps.build-and-push.outputs.digest }} | |
| push-to-registry: true | |
| - name: GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: "Gateway Release v${{ env.VERSION }}" | |
| body: | | |
| ## Docker Image Information | |
| **Image**: `docker.io/${{ vars.DOCKERHUB_ORG }}/dstack-gateway:${{ env.VERSION }}` | |
| **Digest (SHA256)**: `${{ steps.build-and-push.outputs.digest }}` | |
| **Verification**: [Verify on Sigstore](https://search.sigstore.dev/?hash=${{ steps.build-and-push.outputs.digest }}) |