Skip to content
Open
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
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: write
packages: write

jobs:
release:
Expand Down Expand Up @@ -120,3 +121,65 @@ 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#${{ github.ref }}
platforms: ${{ matrix.platform }}
push: true
tags: ghcr.io/upsun/cli:${{ github.ref_name }}-${{ matrix.suffix }}
build-args: |
VERSION=${{ github.ref_name }}
cache-from: type=gha,scope=${{ matrix.suffix }}
cache-to: type=gha,mode=max,scope=${{ matrix.suffix }}

docker-manifest:
runs-on: ubuntu-latest
needs: docker
permissions:
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 manifest
run: |
docker manifest create ghcr.io/upsun/cli:${{ github.ref_name }} \
ghcr.io/upsun/cli:${{ github.ref_name }}-amd64 \
ghcr.io/upsun/cli:${{ github.ref_name }}-arm64
docker manifest push ghcr.io/upsun/cli:${{ github.ref_name }}
docker manifest create ghcr.io/upsun/cli:latest \
ghcr.io/upsun/cli:${{ github.ref_name }}-amd64 \
ghcr.io/upsun/cli:${{ github.ref_name }}-arm64
docker manifest push ghcr.io/upsun/cli:latest
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:24.04

# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends curl bash git ssh-client && \
rm -rf /var/lib/apt/lists/*

# Install Upsun CLI
ARG VERSION=
RUN curl -fsSL https://raw.githubusercontent.com/upsun/cli/main/installer.sh | INSTALL_METHOD=raw VERSION=$VERSION bash

# Default command
ENTRYPOINT ["upsun"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ 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
```

To use a specific version:

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

## Upgrade

Upgrade using the same tool:
Expand Down Expand Up @@ -188,6 +202,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