Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ on:
permissions:
contents: write

env:
IMAGE: ghcr.io/upsun/cli

jobs:
release:
runs-on: ubuntu-latest
environment: production
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.tag }}
is_prerelease: ${{ steps.tag.outputs.is_prerelease }}

steps:
- name: Resolve tag
Expand Down Expand Up @@ -163,3 +171,70 @@ jobs:
if: always()
run: |
rm -rf "${{ steps.signing-keys.outputs.key_dir }}"

docker:
runs-on: ${{ matrix.runner }}
needs: release
strategy:
matrix:
include:
- runner: ubuntu-latest
platform: linux/amd64
suffix: amd64
- runner: ubuntu-24.04-arm
platform: linux/arm64
suffix: arm64
permissions:
contents: read
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: https://github.com/${{ github.repository }}.git#${{ needs.release.outputs.tag }}
platforms: ${{ matrix.platform }}
push: true
tags: ${{ env.IMAGE }}:${{ needs.release.outputs.tag }}-${{ matrix.suffix }}
build-args: |
VERSION=${{ needs.release.outputs.tag }}
cache-from: type=gha,scope=${{ matrix.suffix }}
cache-to: type=gha,mode=max,scope=${{ matrix.suffix }}

docker-manifest:
runs-on: ubuntu-latest
needs: [docker, release]
permissions:
contents: read
packages: write
steps:
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push versioned manifest
run: |
docker buildx imagetools create \
--tag ${{ env.IMAGE }}:${{ needs.release.outputs.tag }} \
${{ env.IMAGE }}:${{ needs.release.outputs.tag }}-amd64 \
${{ env.IMAGE }}:${{ needs.release.outputs.tag }}-arm64

- name: Create and push latest manifest
if: needs.release.outputs.is_prerelease == 'false'
run: |
docker buildx imagetools create \
--tag ${{ env.IMAGE }}:latest \
${{ env.IMAGE }}:${{ needs.release.outputs.tag }}-amd64 \
${{ env.IMAGE }}:${{ needs.release.outputs.tag }}-arm64
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM alpine:3

RUN apk add --no-cache ca-certificates curl git openssh-client

ARG VERSION=
RUN [ -n "$VERSION" ] || { echo "VERSION is required" >&2; exit 1; }
COPY installer.sh /tmp/installer.sh
RUN INSTALL_METHOD=raw VERSION=$VERSION sh /tmp/installer.sh && rm /tmp/installer.sh

ENTRYPOINT ["upsun"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ sudo dnf install -y upsun-cli

For manual installation, you can also [download the latest binaries](https://github.com/upsun/cli/releases/latest).

### Docker

The CLI is also available as a Docker image:

```console
docker run --rm -it ghcr.io/upsun/cli
```

## Upgrade

Upgrade using the same tool:
Expand Down Expand Up @@ -188,6 +196,7 @@ Releases are automated via GitHub Actions. To create a new release:
- Sign packages (APK, DEB, RPM)
- Create a GitHub release with all artifacts
- Update package repositories at repositories.upsun.com
- Build and push Docker image to ghcr.io/upsun/cli

## Licenses

Expand Down
Loading