From e880f2770e0517b4e214038c273bfc02658c7ef4 Mon Sep 17 00:00:00 2001 From: Till Rohrmann Date: Thu, 14 Dec 2023 11:33:01 +0100 Subject: [PATCH] Remove Docker image build for documentation This commit removes the Docker builds for the documentation since it is now publicly available on the internet. This fixes #214. --- .github/workflows/docker.yml | 66 ----------------------------------- .github/workflows/release.yml | 6 ---- README.md | 14 +------- docker/Dockerfile | 21 ----------- docker/nginx.conf | 47 ------------------------- 5 files changed, 1 insertion(+), 153 deletions(-) delete mode 100644 .github/workflows/docker.yml delete mode 100644 docker/Dockerfile delete mode 100644 docker/nginx.conf diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 1be3afb1..00000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Build Docker image - -on: - workflow_call: - workflow_dispatch: - -env: - REGISTRY: 'ghcr.io' - REPOSITORY: ${{ github.repository_owner }} - REGISTRY_USERNAME: ${{ github.actor }} - REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - timeout-minutes: 30 - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Setup caching - - name: Set up QEMU dependency - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.REGISTRY_USERNAME }} - password: ${{ env.REGISTRY_TOKEN }} - - - name: Extract image name - # Set repository name as image name - run: | - echo "IMAGE_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }} - # Note: We need this to generate the latest tag until we have a first stable release. - # Check https://github.com/docker/metadata-action/issues/34 - flavor: | - latest=true - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - - - name: Build and Push Docker image - id: build - uses: docker/build-push-action@v3 - with: - context: . - file: "docker/Dockerfile" - push: true - tags: ${{ steps.meta.outputs.tags }} - load: false - labels: ${{ steps.meta.outputs.labels }} - platforms: "linux/arm64,linux/amd64" - cache-from: type=gha,scope=${{ github.workflow }} - cache-to: type=gha,mode=max,scope=${{ github.workflow }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbd54d96..d01bb2f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,14 +6,8 @@ on: - v** jobs: - build-docker-image: - name: Build docker image - uses: ./.github/workflows/docker.yml - secrets: inherit - create-release: name: Create release - needs: [build-docker-image] runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 015abb87..dfbc46c4 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,6 @@ This repository contains Restate's documentation: https://docs.restate.dev/ -## Offline use - -You can read the Restate documentation offline by downloading the docker image: - -```shell -docker run --rm -p 3000:80 ghcr.io/restatedev/documentation:latest -``` - -This will serve the documentation under `localhost:3000`. - -You can also check this repository out and build the documentation yourself by following the instructions below. - ## Developing the documentation The documentation is built using [Docusaurus 2](https://docusaurus.io/). @@ -59,7 +47,7 @@ git tag -m "Documentation v0.3.0" v0.3.0 git push --tags ``` -The tag triggers the build of the new `restatedev/documentation:vX.Y.Z` container image and creates a draft [release on Github](https://github.com/restatedev/documentation/releases) that needs manual approval. +The tag triggers creating a draft [release on Github](https://github.com/restatedev/documentation/releases) that needs manual approval. Moreover, it will push the latest `main` to the `production` branch which triggers the deployment of the documentation. ### Manually update the schemas diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 0f741691..00000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM --platform=$BUILDPLATFORM node:lts as builder - -# Reduce npm log spam and colour during install within Docker -ENV NPM_CONFIG_LOGLEVEL=warn -ENV NPM_CONFIG_COLOR=false - -WORKDIR /restate-documentation -# Copy the source code over -COPY . . -# Install (not ci) with dependencies, and for Linux vs. Linux Musl (which we use for -alpine) -RUN yarn -# Build the Restate documentation -RUN yarn build - -# Use a stable nginx image for serving the documentation -FROM nginx:stable-alpine as deploy -WORKDIR /restate-documentation -# Copy what we've built from production -COPY --from=builder /restate-documentation/build /usr/share/nginx/html/ -# Update nginx configuration -COPY --from=builder /restate-documentation/docker/nginx.conf /etc/nginx/ diff --git a/docker/nginx.conf b/docker/nginx.conf deleted file mode 100644 index b12d777d..00000000 --- a/docker/nginx.conf +++ /dev/null @@ -1,47 +0,0 @@ -user nginx; -worker_processes auto; - -error_log /var/log/nginx/error.log notice; -pid /var/run/nginx.pid; - - -events { - worker_connections 1024; -} - - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - - sendfile on; - #tcp_nopush on; - - keepalive_timeout 65; - - #gzip on; - - server { - listen 80; - server_name localhost; - - root /usr/share/nginx/html; - - # keep request port - absolute_redirect off; - - # redirect /docs/ to / as some browsers may have the old /docs/ redirect cached - location = /docs/ { - return 301 /; - } - location = /docs { - return 301 /; - } - } -}