This commit is contained in:
@@ -3,6 +3,10 @@ name: Build and Push Docker Image
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
IMAGE_NAME: gitea.umbra.mom/ciaran/football-competitiveness
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -21,10 +25,18 @@ jobs:
|
||||
-u "$REGISTRY_USER" \
|
||||
--password-stdin
|
||||
|
||||
- name: Build image
|
||||
- name: Set up buildx
|
||||
run: |
|
||||
docker build -t gitea.umbra.mom/ciaran/football-competitiveness:latest .
|
||||
docker buildx create --name ci-builder --driver docker-container --use || docker buildx use ci-builder
|
||||
docker buildx inspect --bootstrap
|
||||
|
||||
- name: Push image
|
||||
- name: Build and push image (with cache)
|
||||
run: |
|
||||
docker push gitea.umbra.mom/ciaran/football-competitiveness:latest
|
||||
docker buildx build \
|
||||
--pull \
|
||||
--platform linux/amd64 \
|
||||
-t "${IMAGE_NAME}:latest" \
|
||||
--cache-from "type=registry,ref=${IMAGE_NAME}:buildcache" \
|
||||
--cache-to "type=registry,ref=${IMAGE_NAME}:buildcache,mode=max" \
|
||||
--push \
|
||||
.
|
||||
|
||||
+3
-3
@@ -22,11 +22,11 @@ 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)"
|
||||
RUN R --vanilla -e "install.packages('renv', repos='https://cran.rstudio.com')" && \
|
||||
R --vanilla -e "renv::restore(project='/srv/shiny-server', lockfile='/srv/shiny-server/renv.lock', prompt=FALSE)"
|
||||
|
||||
# Permissions
|
||||
RUN chown -R shiny:shiny /srv/shiny-server
|
||||
|
||||
Reference in New Issue
Block a user