Verified Commit 32471b18 authored by Sevan Murriguian-Watrin's avatar Sevan Murriguian-Watrin
Browse files

ci: add .gitlab-ci to push site to s3

parent 1d740910
Pipeline #5558 passed with stages
in 2 minutes and 12 seconds
stages:
- site-builder
- site-publisher
.template: &template
stage: site-publisher
image: docker:stable
services:
- docker:dind
dependencies:
- site-builder
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- |
docker run \
--rm \
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
-e CRI_BUCKET=${CRI_BUCKET} \
-v $(pwd)/site:/srv/site \
registry.cri.epita.fr/cri/docker/arch-cri/master \
aws s3 --endpoint-url https://s3.cri.epita.fr/ sync /srv/site $CRI_BUCKET --acl public-read --delete
site-builder:
stage: site-builder
image:
name: squidfunk/mkdocs-material:latest
entrypoint: [""]
script:
- mkdocs build
artifacts:
expire_in: 1 days
paths:
- site
site-publisher:release:
<<: *template
only:
- master
variables:
AWS_SECRET_ACCESS_KEY: $cri_doc_secret
AWS_ACCESS_KEY_ID: $cri_doc_access
CRI_BUCKET: $cri_doc_bucket
site-publisher:dev:
<<: *template
except:
- master
variables:
AWS_SECRET_ACCESS_KEY: $cri_doc_dev_secret
AWS_ACCESS_KEY_ID: $cri_doc_dev_access
CRI_BUCKET: $cri_doc_dev_bucket
...@@ -2,3 +2,14 @@ ...@@ -2,3 +2,14 @@
The goal of this repository is to store in one place the various documentation regarding the services offered by the CRI to the school and its students. The goal of this repository is to store in one place the various documentation regarding the services offered by the CRI to the school and its students.
This documentation can be read [here](https://doc.cri.epita.fr). This documentation can be read [here](https://doc.cri.epita.fr).
You can build the site with:
```bash
mkdocs build
```
You can also build and test the site locally with:
```bash
mkdocs serve
```
The website will be available at localhost:8000
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment