Adding continuous integration for website

This commit is contained in:
David Négrier 2020-06-01 16:12:48 +02:00
parent d20e85eba6
commit 0574cb7d33
3 changed files with 44 additions and 1 deletions

View File

@ -56,6 +56,29 @@ jobs:
tags: ${{ env.GITHUB_REF_SLUG }} tags: ${{ env.GITHUB_REF_SLUG }}
add_git_labels: true 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: deeploy:
needs: needs:
- build-front - build-front

View File

@ -19,13 +19,24 @@
"front": { "front": {
"image": "thecodingmachine/workadventure-front:"+tag, "image": "thecodingmachine/workadventure-front:"+tag,
"host": { "host": {
"url": url, "url": "play."+url,
"https": "enable" "https": "enable"
}, },
"ports": [80], "ports": [80],
"env": { "env": {
"API_URL": "https://api."+url "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": { "config": {

9
landing_page/Dockerfile Normal file
View File

@ -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/