Adding continuous integration for website
This commit is contained in:
parent
d20e85eba6
commit
0574cb7d33
23
.github/workflows/build-and-deploy.yml
vendored
23
.github/workflows/build-and-deploy.yml
vendored
@ -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
|
||||||
|
@ -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
9
landing_page/Dockerfile
Normal 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/
|
Loading…
Reference in New Issue
Block a user