File tree Expand file tree Collapse file tree 9 files changed +67
-12
lines changed Expand file tree Collapse file tree 9 files changed +67
-12
lines changed Original file line number Diff line number Diff line change 1+ node_modules
2+ .git
Original file line number Diff line number Diff line change 3535 with :
3636 name : website
3737 path : ./public
38+
39+ - name : Configure AWS credentials
40+ uses : aws-actions/configure-aws-credentials@v1
41+ with :
42+ aws-access-key-id : ${{ secrets.DELPHI_ECR_ACCESS_ID }}
43+ aws-secret-access-key : ${{ secrets.DELPHI_ECR_ACCESS_KEY }}
44+ aws-region : us-east-1
45+
46+ - name : Login to Amazon ECR
47+ id : login-ecr
48+ uses : aws-actions/amazon-ecr-login@v1
49+
50+ - name : Build, tag, and push image to Amazon ECR
51+ env :
52+ ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
53+ ECR_REPOSITORY : ${{ github.event.repository.name }}
54+ run : |
55+ baseRef="${GITHUB_REF#*/}"
56+ baseRef="${baseRef#*/}"
57+ case "${baseRef}" in
58+ main)
59+ awsTag="latest"
60+ ;;
61+ *)
62+ awsTag="${baseRef//\//_}" # replace `/` with `_` in branch name
63+ ;;
64+ esac
65+ echo "using tag: --${awsTag}--"
66+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag --file ./devops/precompiled/Dockerfile .
67+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag
Original file line number Diff line number Diff line change 2424* .woff2
2525* .R
2626* .xml
27+ .dockerignore
2728* .Rmd
2829* .md
2930* .jpeg
30- * .ico
31+ * .ico
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # docker image building and packaging the website
2+ FROM node:lts-buster AS builder
3+ WORKDIR /src
4+ COPY . ./
5+ RUN npm ci --unsafe-perm
6+ RUN npm run build
7+
8+ FROM nginx:stable-alpine
9+ COPY --from=builder /src/public /usr/share/nginx/html
10+ # ensure files are readable at runtime
11+ RUN chmod o+r -R /usr/share/nginx/html/
Original file line number Diff line number Diff line change 1+ # docker image using the current built website
2+ FROM nginx:stable-alpine
3+
4+ COPY ./public /usr/share/nginx/html
5+ # ensure files are readable at runtime
6+ RUN chmod o+r -R /usr/share/nginx/html/
Original file line number Diff line number Diff line change 1+ # docker image for setting up an R environment
2+ FROM continuumio/miniconda
3+
4+ ADD ./environment.yml .
5+ RUN conda env create -f environment.yml
6+
7+ ADD ./dependencies.R .
8+
9+ RUN conda run -n www-main Rscript ./dependencies.R
10+
11+ ENV PATH /opt/conda/envs/www-main/bin:$PATH
Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ version: "3.1"
33# docker services for R environment and Hugo runner
44services :
55 r :
6- build : " ."
6+ build :
7+ context : .
8+ dockerfile : devops/r/Dockerfile
79 working_dir : " /app"
810 command : tail -F anything
911 volumes :
1012 - " ./:/app"
1113 # run: docker-compose exec r bash
12- # conda activate www-main
1314 # Rscript -e 'blogdown::build_site(run_hugo=FALSE, build_rmd=TRUE)'
1415
1516 # see https://github.com/peaceiris/hugo-extended-docker
Original file line number Diff line number Diff line change 2626 "start" : " hugo server -D" ,
2727 "start:blog" : " Rscript -e \" blogdown::serve_site()\" " ,
2828 "format" : " prettier *.* \" (.vscode|content|data|themes)/**\" --write" ,
29- "lint" : " prettier *.* \" (.vscode|content|data|themes)/**\" --check"
29+ "lint" : " prettier *.* \" (.vscode|content|data|themes)/**\" --check" ,
30+ "image" : " docker build -t www-main:latest --file ./devops/Dockerfile ."
3031 },
3132 "hugo-bin" : {
3233 "buildTags" : " extended"
You can’t perform that action at this time.
0 commit comments