From 5ded2f7ebe3267e0b660d417076d33f8c6abbd7a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 2 Sep 2026 13:52:38 +0200 Subject: [PATCH] feat: add Docker image Closes: https://github.com/kyubisation/angular-server-side-configuration/issues/122 --- .github/workflows/continuous-integration.yml | 7 ++++++ .github/workflows/release.yml | 25 +++++++++++++++++++- Dockerfile | 19 +++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b9ce5d4..5da3ed4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -57,3 +57,10 @@ jobs: run: yarn build:cli - name: 'Test cli' run: yarn test:cli + + build-docker-cli: + runs-on: ubuntu-latest + needs: lint + steps: + - uses: actions/checkout@v6 + - uses: docker/build-push-action@v7 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0083eb..5f81b12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: release_id: release.data.id, name: file, data: await fs.readFileSync(`./dist/cli/${file}`), - }); + }); } release-library: @@ -85,3 +85,26 @@ jobs: npm install --global npm@latest cd dist/angular-server-side-configuration npm publish --tag ${{ steps.npm_tag.outputs.npm_tag }} + + release-docker-cli: + runs-on: ubuntu-latest + needs: release-cli + permissions: + packages: write + steps: + - uses: actions/checkout@v6 + - uses: docker/login-action@v4 + with: + registry: https://ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - run: | + ref_name="${{ github.ref_name }}" + echo "VERSION=${ref_name#v}" >> $GITHUB_ENV + - uses: docker/build-push-action@v7 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: | + ghcr.io/kyubisation/angular-server-side-configuration:latest + ghcr.io/kyubisation/angular-server-side-configuration:${{ env.VERSION }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9d9fa6c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM --platform=$BUILDPLATFORM docker.io/library/golang:alpine AS build +RUN apk add --no-cache jq +ADD package.json go.mod go.sum /src/ +ADD cli /src/cli +WORKDIR /src/cli +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/go/pkg/mod \ + <