diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 57bebf9d..9d632968 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -56,6 +56,29 @@ jobs: tags: ${{ env.GITHUB_REF_SLUG }} add_git_labels: true + build-website: + + runs-on: ubuntu-latest + + steps: + + - name: Checkout + uses: actions/checkout@v2 + + # Create a slugified value of the branch + - uses: rlespinasse/github-slug-action@master + + - name: "Build and push back image" + uses: docker/build-push-action@v1 + with: + dockerfile: landing_page/Dockerfile + path: landing_page/ + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: thecodingmachine/workadventure-website + tags: ${{ env.GITHUB_REF_SLUG }} + add_git_labels: true + deeploy: needs: - build-front diff --git a/deeployer.libsonnet b/deeployer.libsonnet index 3ede2509..cb8cf50a 100644 --- a/deeployer.libsonnet +++ b/deeployer.libsonnet @@ -19,13 +19,24 @@ "front": { "image": "thecodingmachine/workadventure-front:"+tag, "host": { - "url": url, + "url": "play."+url, "https": "enable" }, "ports": [80], "env": { "API_URL": "https://api."+url } + }, + "website": { + "image": "thecodingmachine/workadventure-website:"+tag, + "host": { + "url": url, + "https": "enable" + }, + "ports": [80], + "env": { + "GAME_URL": "https://play."+url + } } }, "config": { diff --git a/landing_page/Dockerfile b/landing_page/Dockerfile new file mode 100644 index 00000000..d496000e --- /dev/null +++ b/landing_page/Dockerfile @@ -0,0 +1,9 @@ +# we are rebuilding on each deploy to cope with the GAME_URL environment URL +FROM thecodingmachine/nodejs:12-apache + +COPY --chown=docker:docker . . +RUN yarn install + +ENV NODE_ENV=production +ENV STARTUP_COMMAND_1="yarn run build" +ENV APACHE_DOCUMENT_ROOT=dist/