-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82c0da8
commit 21d9261
Showing
13 changed files
with
655 additions
and
368 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 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,96 @@ | ||
name: Build release Docker images | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
# comes from cargo-dist workflow call | ||
plan: | ||
required: true | ||
type: string | ||
|
||
env: | ||
PLAN: ${{ inputs.plan }} | ||
|
||
jobs: | ||
build-docker-image: | ||
name: Build server Docker image | ||
uses: ./.github/workflows/docker.yml | ||
secrets: inherit | ||
with: | ||
pushToDockerHub: true | ||
parca: true | ||
|
||
docker-cli: | ||
name: Push CLI Docker image | ||
runs-on: ubuntu-latest | ||
env: | ||
REPOSITORY_OWNER: ${{ github.repository_owner }} | ||
GHCR_REGISTRY: "ghcr.io" | ||
GHCR_REGISTRY_USERNAME: ${{ github.actor }} | ||
GHCR_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
IMAGE_NAME: "restate-cli" | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log into GitHub container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.GHCR_REGISTRY }} | ||
username: ${{ env.GHCR_REGISTRY_USERNAME }} | ||
password: ${{ env.GHCR_REGISTRY_TOKEN }} | ||
|
||
- name: Log into DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Download linux binaries | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: artifacts-*-unknown-linux-musl-* | ||
merge-multiple: true | ||
|
||
- name: Write release version | ||
id: version | ||
run: | | ||
VERSION="$(echo "$PLAN" | jq -r '[.releases[] | select(.app_name == "restate-cli")][0].app_version')" | ||
echo Version: ${VERSION} | ||
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.GHCR_REGISTRY }}/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }} | ||
${{ format('docker.io/{0}/{1}', env.REPOSITORY_OWNER, env.IMAGE_NAME) }} | ||
tags: | | ||
type=semver,pattern={{version}},value=${{ steps.version.outputs.VERSION }} | ||
type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.VERSION }} | ||
- name: Create Dockerfile | ||
run: | | ||
cat > Dockerfile << 'EOF' | ||
FROM --platform=${BUILDPLATFORM} alpine as builder | ||
ADD restate-cli-aarch64-unknown-linux-musl.tar.xz /restate-arm64 | ||
ADD restate-cli-x86_64-unknown-linux-musl.tar.xz /restate-amd64 | ||
# keep output image small by removing the server binary | ||
RUN rm /restate-*/restate-server | ||
FROM alpine | ||
ARG TARGETARCH | ||
COPY --from=builder /restate-${TARGETARCH} / | ||
ENTRYPOINT [ "/restate" ] | ||
EOF | ||
- name: Build and push multiplatform image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/arm64,linux/amd64 |
This file contains 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.