From 65d1eeb0a2f3ab253efca50d98d6a14c3fa3103c Mon Sep 17 00:00:00 2001 From: Thomas <1684858+Falx@users.noreply.github.com> Date: Fri, 21 Jan 2022 11:00:48 +0100 Subject: [PATCH] chore: Build and push official docker image in CI * docker job added to ci.yml * removed temporary manual build stuff * updated readme for new docker image * updated changelog * Revert "updated changelog" This reverts commit 20d99a2e27e19ffb7a31cbddddb7daab8206b3c8. Co-authored-by: Thomas Dupont --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 13 ++++++------- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 921d7ac1a..26c1bc8d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,6 +139,46 @@ jobs: github-token: ${{ secrets.github_token }} parallel-finished: true + docker: + needs: + - lint + - test-unit + - test-integration + - test-integration-windows + - validate-components + # Only run on tags starting with v prefix for now -- extra push need for triggering CI again + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + solidproject/community-server + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + github-token: ${{ secrets.github_token }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + docs: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index ed9385162..e04dc924d 100644 --- a/README.md +++ b/README.md @@ -69,21 +69,20 @@ npm start -- # add parameters if needed ``` ### 📦 Running via Docker -Docker allows you to run the server without having Node.js installed: +Docker allows you to run the server without having Node.js installed. Images are built on each tagged version and hosted on [Docker Hub](https://hub.docker.com/r/solidproject/community-server). + ```shell +# Clone the repo to get access to the configs git clone https://github.com/solid/community-server.git cd community-server -# Build the Docker image -docker build --rm -f Dockerfile -t css:latest . # Run the image, serving your `~/Solid` directory on `http://localhost:3000` -docker run --rm -v ~/Solid:/data -p 3000:3000 -it css:latest +docker run --rm -v ~/Solid:/data -p 3000:3000 -it solidproject/community-server:latest # Or use one of the built-in configurations -docker run --rm -p 3000:3000 -it css:latest -c config/default.json +docker run --rm -p 3000:3000 -it solidproject/community-server -c config/default.json # Or use your own configuration mapped to the right directory -docker run --rm -v ~/solid-config:/config -p 3000:3000 -it css:latest -c /config/my-config.json +docker run --rm -v ~/solid-config:/config -p 3000:3000 -it solidproject/community-server -c /config/my-config.json ``` - ## 🔧 Configuring the server The Community Solid Server is designed to be flexible such that people can easily run different configurations.