-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #493 from inbo/492-github-action-voor-automatische…
…-deployment-op-nieuwe-omgeving 👷 Add deployment uat workflow
- Loading branch information
Showing
17 changed files
with
120 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- uat | ||
jobs: | ||
build: | ||
name: Build and upload Docker image | ||
runs-on: [self-hosted] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | ||
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Build, tag, and push docker image to Amazon ECR | ||
env: | ||
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
REPOSITORY: ${{ secrets.AWS_ECR_REPOSITORY }} | ||
IMAGE_TAG: ${{ github.sha }} | ||
UAT_TAG: uat | ||
run: | | ||
docker build --build-arg GIT_SHA=${{ github.sha }} -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -t $REGISTRY/$REPOSITORY:$UAT_TAG . | ||
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG | ||
docker push $REGISTRY/$REPOSITORY:$UAT_TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
FROM openanalytics/r-ver:4.0.5 | ||
FROM rocker/r-ver:4.3.2 | ||
|
||
LABEL maintainer="Machteld Varewyck [email protected]" | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
gdal-bin \ | ||
libproj15 \ | ||
libgeos-3.8.0 libgeos-c1v5 \ | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
libgdal-dev \ | ||
libproj22 \ | ||
libgeos3.10.2 libgeos-c1v5 \ | ||
libcurl4-openssl-dev \ | ||
curl \ | ||
ca-certificates \ | ||
pandoc \ | ||
libudunits2-0 \ | ||
libudunits2-dev \ | ||
libmagick++-dev \ | ||
libssl-dev \ | ||
lmodern \ | ||
fonts-cantarell \ | ||
texlive-latex-extra \ | ||
texlive-xetex \ | ||
texlive-fonts-recommended \ | ||
texlive-plain-generic \ | ||
texlive-fonts-extra \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
lmodern \ | ||
wget && \ | ||
wget https://downloads.vivaldi.com/stable/vivaldi-stable_6.8.3381.55-1_$(dpkg --print-architecture).deb && \ | ||
apt-get install --no-install-recommends -y ./vivaldi-stable*.deb && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Use the remotes package instead of devtools as it is much lighter | ||
RUN R -q -e "install.packages('remotes')" | ||
|
||
RUN R -q -e "remotes::install_cran(c('shiny', 'sf', 'dplyr', 'plyr', 'reshape2', 'mgcv', 'stringr', 'leaflet', 'flexdashboard', 'testthat', 'shinyjs', 'data.table', 'tinytex', 'tidyr', 'arrow', 'kableExtra'))" | ||
RUN R -q -e "remotes::install_version('DT', version = '0.23', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
RUN R -q -e "remotes::install_version('plotly', version = '4.10.1', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
RUN R -q -e "remotes::install_version('rmarkdown', version = '2.18', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
RUN R -q -e "remotes::install_version('magick', version = '2.7.3', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
RUN R -q -e "options(warn = 2); remotes::install_cran(c('shiny', 'sf', 'dplyr', 'plyr', 'reshape2', 'mgcv', 'stringr', 'leaflet', 'flexdashboard', 'testthat', 'shinyjs', 'data.table', 'tinytex', 'tidyr', 'arrow', 'kableExtra', 'webshot2'))" | ||
RUN R -q -e "options(warn = 2); remotes::install_version('DT', version = '0.23', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
RUN R -q -e "options(warn = 2); remotes::install_version('plotly', version = '4.10.1', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
RUN R -q -e "options(warn = 2); remotes::install_version('rmarkdown', version = '2.18', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
RUN R -q -e "options(warn = 2); remotes::install_version('magick', version = '2.7.3', repos = 'https://cloud.r-project.org', upgrade = 'never')" | ||
# NOTE: Need at least these versions of plotly, rmarkdown and magick for dashboard rmarkdown to work | ||
|
||
RUN R -q -e "remotes::install_github('inbo/[email protected]')" | ||
RUN R -q -e "install.packages('oaStyle', repos = c(rdepot = 'https://repos.openanalytics.eu/repo/public', getOption('repos')))" | ||
|
||
# to prevent bobbing with shinycssloaders | ||
RUN R -q -e "remotes::install_github('daattali/shinycssloaders')" | ||
RUN R -q -e "options(warn = 2); remotes::install_github(c('inbo/[email protected]', 'daattali/shinycssloaders'))" | ||
|
||
# For the rmarkdown pdf report | ||
RUN R -e "tinytex::install_tinytex()" | ||
ENV PATH="/root/bin:${PATH}" | ||
# many packages needed for kableExtra background feature | ||
RUN R -e "tinytex::tlmgr_install(pkgs = c('fancyhdr', 'sectsty', 'titling', 'grffile', 'texlive-scripts', 'mathspec', 'multirow', 'wrapfig', 'colortbl', 'pdflscape', 'tabu', 'varwidth', 'threeparttable', 'threeparttablex', 'environ', 'trimspaces', 'ulem', 'makecell'))" | ||
RUN R -q -e "options(warn = 2); install.packages('oaStyle', repos = c(rdepot = 'https://repos.openanalytics.eu/repo/public', getOption('repos')))" | ||
#RUN R -e "tinytex::install_tinytex()" | ||
#ENV PATH="/root/bin:${PATH}" | ||
## many packages needed for kableExtra background feature | ||
#RUN R -e "tinytex::tlmgr_install(pkgs = c('fancyhdr', 'sectsty', 'titling', 'grffile', 'texlive-scripts', 'mathspec', 'multirow', 'wrapfig', 'colortbl', 'pdflscape', 'tabu', 'varwidth', 'threeparttable', 'threeparttablex', 'environ', 'trimspaces', 'ulem', 'makecell'))" | ||
|
||
# For downloading the maps | ||
# Attention: do not install phantomjs directly, will not work then! | ||
RUN R -q -e "remotes::install_cran('webshot')" | ||
RUN R -e "webshot::install_phantomjs()" | ||
# Configure browser for using webshot2 | ||
ENV CHROMOTE_CHROME=/usr/bin/vivaldi | ||
|
||
# Git sha | ||
ARG GIT_SHA | ||
ENV GIT_SHA=$GIT_SHA | ||
|
||
# For access to S3 on UAT | ||
# For calculating areas - fix #435 | ||
RUN R -q -e "remotes::install_cran(c('config', 'aws.s3', 'aws.ec2metadata', 'lwgeom'))" | ||
RUN R -q -e "options(warn = 2); remotes::install_cran(c('config', 'aws.s3', 'aws.ec2metadata', 'aws.signature'))" | ||
|
||
|
||
# Install the package without the source files ending up in the Docker image | ||
COPY reporting-grofwild /tmp/package | ||
RUN R -q -e "remotes::install_local('/tmp/package', dependencies=FALSE)" | ||
RUN R -q -e "options(warn = 2); remotes::install_local('/tmp/package', dependencies=FALSE)" | ||
|
||
# set host | ||
COPY Rprofile.site /usr/local/lib/R/etc/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
default: | ||
bucket: inbo-wbe-uat-data | ||
bucket: inbo-faunabeheer-uat-eu-west-1-default | ||
credentials: | ||
region: Sys.getenv('AWS_DEFAULT_REGION', unset = 'eu-west-1') | ||
id: Sys.getenv('AWS_ACCESS_KEY_ID') | ||
secret: Sys.getenv('AWS_SECRET_ACCESS_KEY') | ||
token: Sys.getenv('AWS_SESSION_TOKEN') | ||
datacheck: false | ||
defaultYear: 2023 | ||
|
||
uat: | ||
datacheck: false | ||
|
||
production: | ||
bucket: inbo-wbe-prd-data | ||
bucket: inbo-faunabeheer-prd-eu-west-1-default | ||
datacheck: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.