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..ba7bb0d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:24.04 + +# Install dependencies +RUN apt-get update && \ + apt-get install -y curl bash git ssh-client && \ + rm -rf /var/lib/apt/lists/* + +# 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 + +# Default command +ENTRYPOINT ["upsun"]