diff --git a/.github/workflows/docker-hub-publish.yml b/.github/workflows/docker-hub-publish.yml new file mode 100644 index 0000000..513ef73 --- /dev/null +++ b/.github/workflows/docker-hub-publish.yml @@ -0,0 +1,36 @@ +name: Publish DockerHub image +# from https://itsmetommy.com/2021/07/05/push-to-docker-hub-using-github-actions/ + +on: + push: + tags: + - '*' + +jobs: + build-container: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: silexlabs/silex-platform + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + diff --git a/README.md b/README.md index 6ab2546..d8dc0bf 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,41 @@ This code adds features to the editor specific to our instance (in `index.js` an * [x] Enable or disable cloud services and hosting providers with env vars * [ ] Analytics: add a tag in Silex editor +## Run the code + +### With Docker + +```bash +docker run -p 8080:8080 silexlabs/silex-instances +``` + +Add environment variables to customize the instance - here is an example with FTP storage and FTP hosting: + +```bash +docker run -p 8080:8080 -e STORAGE_CONNECTORS=ftp -e HOSTING_CONNECTORS=ftp,download silexlabs/silex-instances +``` + +More info: + +* [Env vars are described below](#environment-variables) +* [Docker Hub](https://hub.docker.com/r/silexlabs/silex-instances) +* [Dockerfile](Dockerfile) +* [What is storage and hosting](https://docs.silex.me/en/dev/connect) + +### With Node.js + +```bash +npm install +npm start +``` + +Or for development: + +```bash +npm install +npm run dev +``` + ## Environment variables You can set the following environment variables to customize the instance: diff --git a/package.json b/package.json index 0922614..088156c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "editor.silex.me", + "name": "@silexlabs/silex-platform", "version": "1.0.158", "description": "This repo holds the code for the free public Silex instance hosted by Silex Labs foundation", "scripts": {