From c84b813e6b33ceda8a16e5f58b0e0955f149c16a Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Mon, 7 Jul 2025 18:29:25 +0300 Subject: [PATCH 1/2] feat(docker): publish a Docker image to GHCR on every release --- .github/workflows/publish-ghcr.yml | 35 ++++++++++++++++++++++++++++++ Dockerfile | 13 +++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/publish-ghcr.yml create mode 100644 Dockerfile diff --git a/.github/workflows/publish-ghcr.yml b/.github/workflows/publish-ghcr.yml new file mode 100644 index 0000000..c0cf889 --- /dev/null +++ b/.github/workflows/publish-ghcr.yml @@ -0,0 +1,35 @@ +name: Publish Docker image to GHCR + +on: + release: + types: [published] + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - 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: . + file: ./Dockerfile + push: true + tags: | + ghcr.io/platformsh/upsun-cli:${{ github.event.release.tag_name }} + ghcr.io/platformsh/upsun-cli:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ce5bda4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:latest + +# Install dependencies +RUN apt-get update && \ + apt-get install -y curl bash && \ + rm -rf /var/lib/apt/lists/* + +# Install Platform.sh CLI +ARG VERSION= +RUN curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | VENDOR=upsun INSTALL_METHOD=raw VERSION=$VERSION bash + +# Default command +ENTRYPOINT ["upsun"] From 51c1ea6c7e07363206248ee3634b07875536f25f Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Mon, 21 Jul 2025 09:20:58 +0300 Subject: [PATCH 2/2] Apply @pjcdawkins code review suggestions Co-authored-by: Patrick Dawkins --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce5bda4..ba7bb0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM ubuntu:latest +FROM ubuntu:24.04 # Install dependencies RUN apt-get update && \ - apt-get install -y curl bash && \ + apt-get install -y curl bash git ssh-client && \ rm -rf /var/lib/apt/lists/* -# Install Platform.sh CLI +# Install Upsun CLI ARG VERSION= RUN curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | VENDOR=upsun INSTALL_METHOD=raw VERSION=$VERSION bash