From 8956d0f1338c4e941fa914e25058c88aabd42d0b Mon Sep 17 00:00:00 2001 From: John Gatward Date: Tue, 4 Aug 2026 19:54:47 +0100 Subject: [PATCH] [main]: action --- .Dockerfile.ci | 37 ++++++++++++++++++++++++++++++++++++ .gitea/workflows/docker.yaml | 30 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .Dockerfile.ci create mode 100644 .gitea/workflows/docker.yaml diff --git a/.Dockerfile.ci b/.Dockerfile.ci new file mode 100644 index 0000000..85d68a6 --- /dev/null +++ b/.Dockerfile.ci @@ -0,0 +1,37 @@ +FROM rocker/shiny:4.4.0 + +# System dependencies commonly required by R packages +RUN apt-get update && apt-get install -y \ + libcurl4-openssl-dev \ + libssl-dev \ + libxml2-dev \ + libgit2-dev \ + libfontconfig1-dev \ + libharfbuzz-dev \ + libfribidi-dev \ + libfreetype6-dev \ + libpng-dev \ + libjpeg-dev \ + libtiff5-dev \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /srv/shiny-server + +# Copy the application +COPY . /srv/shiny-server/ + +# Prevent renv attempting to use pak +ENV RENV_CONFIG_PAK_ENABLED=FALSE +ENV CFLAGS=-Wno-error=format-security + +# Install renv and restore project packages +RUN R -e "install.packages('renv', repos='https://cran.rstudio.com'); \ + renv::init(bare = TRUE); \ + renv::restore(prompt = FALSE)" + +# Permissions +RUN chown -R shiny:shiny /srv/shiny-server + +EXPOSE 3838 + +CMD ["/usr/bin/shiny-server"] diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml new file mode 100644 index 0000000..28a3069 --- /dev/null +++ b/.gitea/workflows/docker.yaml @@ -0,0 +1,30 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Gitea Registry + env: + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + run: | + echo "$REGISTRY_TOKEN" | docker login gitea.umbra.mom \ + -u "$REGISTRY_USER" \ + --password-stdin + + - name: Build image + run: | + docker build -t gitea.umbra.mom/ciaran/football-competitiveness:latest . + + - name: Push image + run: | + docker push gitea.umbra.mom/ciaran/football-competitiveness:latest