diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index d2e1f4f..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM ghcr.io/quarto-dev/quarto-full:1.5.22 - -# Avoid warnings by switching to noninteractive -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ - && apt-get -y install git iproute2 procps lsb-release \ - && apt-get -y install python3 python3-pip \ - && apt-get -y install r-base \ - && apt-get -y install julia - -RUN python3 -m pip install jupyter - -# https://discourse.julialang.org/t/how-to-install-all-packages-in-a-project-into-the-general-julia-manifest/84143 -# RUN julia -e "using Pkg; Pkg.instantiate()" -# COPY Project.toml /root/.julia/environments/v1.4/Project.toml -# COPY Manifest.toml /root/.julia/environments/v1.4/Manifest.toml -# RUN julia -e "using Pkg; Pkg.instantiate(); Pkg.precompile()" - -# # RUN quarto serve \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 02a4b91..3d57657 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,15 +1,14 @@ { "name": "Anson's Projects", - "build":{ - "dockerfile": "Dockerfile" - }, + "image": "registry.gitlab.com/anson-projects/projects:latest", "customizations": { "vscode": { "extensions": [ "quarto.quarto", - "julialang.language-julia" + "julialang.language-julia", + "redhat.vscode-yaml", + "ms-azuretools.vscode-docker" ] } } - // "postCreateCommand": "julia -e 'import Pkg; Pkg.activate(\".\"); Pkg.instantiate()'" } \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1362ce..d853934 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,25 +1,27 @@ -image: ghcr.io/quarto-dev/quarto-full:1.5.22 - stages: - build - deploy -build_project: +build:master: stage: build + image: + name: gcr.io/kaniko-project/executor:v1.21.0-debug + entrypoint: [""] script: - - apt-get update - - apt-get -y install --no-install-recommends apt-utils dialog 2>&1 - - apt-get -y install git iproute2 procps lsb-release - - apt-get -y install python3 python3-pip - - apt-get -y install r-base - - apt-get -y install julia - - python3 -m pip install jupyter - - julia -e "using Pkg; Pkg.instantiate(); Pkg.precompile()" - - cp Project.toml /root/.julia/environments/v1.4/Project.toml - - cp Manifest.toml /root/.julia/environments/v1.4/Manifest.toml - - julia -e "using Pkg; Pkg.instantiate(); Pkg.precompile()" - - echo "Building the project with Quarto..." - - quarto render --to html --output-dir public + - /kaniko/executor + --context "${CI_PROJECT_DIR}" + --dockerfile "${CI_PROJECT_DIR}/Dockerfile" + --destination "${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" + --destination "${CI_REGISTRY_IMAGE}:latest" + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + +render-quarto: + stage: deploy + image: ${CI_REGISTRY_IMAGE}:latest + script: + - echo "Building the project with Quarto..." + - quarto render --to html --output-dir public artifacts: paths: - public @@ -29,7 +31,7 @@ pages: script: - echo "Publishing site..." dependencies: - - build_project + - render-quarto artifacts: paths: - public diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4397946 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ghcr.io/quarto-dev/quarto-full:1.5.22 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + apt-utils dialog \ + git iproute2 procps lsb-release \ + python3 python3-pip \ + r-base \ + julia \ + && rm -rf /var/lib/apt/lists/* + +RUN python3 -m pip install jupyter + +# Assuming Project.toml and Manifest.toml are copied to the correct locations +COPY Project.toml /root/.julia/environments/v1.4/ +COPY Manifest.toml /root/.julia/environments/v1.4/ + +RUN julia -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"