Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# [Choice] .NET Core version: 3.1, 2.1
ARG VARIANT=3.1
# Use .NET 8 version
ARG VARIANT=8.0
FROM mcr.microsoft.com/vscode/devcontainers/dotnetcore:dev-${VARIANT}

# [Option] Install Node.js
# [Option] Install Node.js 20.11.1 to match the main Dockerfile
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
ARG NODE_VERSION="20.11.1"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Option] Install Azure CLI
Expand Down
10 changes: 5 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1
"VARIANT": "3.1",
// Update to .NET 8
"VARIANT": "8.0",
// Options
"INSTALL_NODE": "true",
"NODE_VERSION": "14.0",
"NODE_VERSION": "20.11.1",
"INSTALL_AZURE_CLI": "false",
"UPGRADE_PACKAGES": "false"
}
},

"customizations": {
"vscode": {
// Set container specific defaults for F# in .NET Core 2.1+
// Set container specific defaults for F# in .NET 8
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"FSharp.fsacRuntime": "netcore",
"FSharp.fsacRuntime": "net8.0",
"FSharp.useSdkScripts": true
},

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
has_label: ${{ steps.label.outputs.has_label }}

undeploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [check]
if: "needs.check.status_code != '404' && (github.event.action == 'closed' || !needs.check.has_label)"
steps:
- name: Debug
uses: hmarr/debug-action@v2.1.0

- name: Checkout repo
uses: actions/checkout@v4

- name: Undeploy
uses: sledilnik/action-helm-deploy@v1.0.2
with:
action: undeploy
chartName: sledilnik/website
chartVersion: '0.9.0'
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,56 @@

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Debug
uses: hmarr/debug-action@v2.1.0

- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3.6.0
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20.11.1'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3.3.1
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- run: yarn
- run: yarn lint
# - run: yarn test
- run: yarn dotnet-restore
- run: yarn test-fsharp

build:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
if: contains(github.event.pull_request.labels.*.name, 'deploy-preview')
needs: test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push docker container image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
context: .
Expand All @@ -75,45 +75,45 @@
BUILD_MODE=staging

deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: contains(github.event.pull_request.labels.*.name, 'deploy-preview')
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Deploy
uses: sledilnik/action-helm-deploy@v1.0.2
with:
chartName: sledilnik/website
chartVersion: '1.0.0'
kubeconfig: '${{ secrets.KUBECONFIG }}'

- name: Slack notification
uses: 8398a7/action-slack@v3
with:
icon_url: 'https;//github.com/sledilnik.png?size=32'
author_name: 'Deploy bot'
status: custom
fields: repo,workflow,job
custom_payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "PR-${{ github.event.pull_request.number}} deploy finished with status: ${{ job.status }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "URL: ${{ env.DEPLOY_URL }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
16 changes: 8 additions & 8 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,89 +14,89 @@

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Debug
uses: hmarr/debug-action@v2.1.0

- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3.6.0
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20.11.1'
- run: yarn
- run: yarn lint
# - run: yarn test
# - run: yarn dotnet-restore
# - run: yarn test-fsharp

build:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: test
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push docker container image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./Dockerfile
tags: |
ghcr.io/${{ github.repository_owner }}/website:${{ env.IMAGE_TAG}}
build-args: |
BUILD_MODE=production

deploy:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Deploy
uses: sledilnik/action-helm-deploy@v1.0.2
with:
chartName: sledilnik/website
chartVersion: '1.0.0'
kubeconfig: '${{ secrets.KUBECONFIG }}'

- name: Slack notification
uses: 8398a7/action-slack@v3
with:
icon_url: 'https;//github.com/sledilnik.png?size=32'
author_name: 'Deploy bot'
status: custom
fields: repo,workflow,job
custom_payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Production deploy finished with status: ${{ job.status }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "URL: ${{ env.DEPLOY_URL }}"
}
}
]
}
env:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,104 +14,104 @@

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Debug
uses: hmarr/debug-action@v2.1.0

- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3.6.0
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20.11.1'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3.3.1
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- run: yarn
- run: yarn lint
# - run: yarn test
# - run: yarn dotnet-restore
# - run: yarn test-fsharp

build:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: test
if: "!contains(github.event.head_commit.message, 'NOBUILD')"
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push docker container image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./Dockerfile
tags: |
ghcr.io/${{ github.repository_owner }}/website:latest
build-args: |
BUILD_MODE=staging

deploy:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: build
if: "!contains(github.event.head_commit.message, 'NODEPLOY')"
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Deploy
uses: sledilnik/action-helm-deploy@v1.0.2
with:
chartName: sledilnik/website
chartVersion: '1.0.0'
kubeconfig: '${{ secrets.KUBECONFIG }}'

- name: Slack notification
uses: 8398a7/action-slack@v3
with:
icon_url: 'https;//github.com/sledilnik.png?size=32'
author_name: 'Deploy bot'
status: custom
fields: repo,workflow,job
custom_payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Staging deploy finished with status: ${{ job.status }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "URL: ${{ env.DEPLOY_URL }}"
}
}
]
}
env:
Expand Down
45 changes: 40 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,51 @@
########################################
# Intermediate builder image (used only for build, discarded in final stage)
# Build stage - uses native build platform for better performance
########################################
FROM ghcr.io/sledilnik/website-base AS builder
FROM --platform=$BUILDPLATFORM node:20-alpine3.22 AS builder

# Install dependencies needed for .NET SDK on Alpine
RUN apk add --no-cache \
bash \
icu-libs \
krb5-libs \
libgcc \
libintl \
libssl3 \
libstdc++ \
zlib \
wget \
ca-certificates

# Install .NET 8 SDK manually for multi-arch support
ARG TARGETARCH
RUN case ${TARGETARCH} in \
"amd64") DOTNET_ARCH=x64 ;; \
"arm64") DOTNET_ARCH=arm64 ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
esac \
&& wget -O dotnet.tar.gz "https://download.visualstudio.microsoft.com/download/pr/9c8b7bf6-fbf3-451b-925d-dd5d9473cc84/be4015516d88ad6a38b85f86b7d8db0b/dotnet-sdk-8.0.404-linux-musl-${DOTNET_ARCH}.tar.gz" \
&& mkdir -p /usr/share/dotnet \
&& tar -xzf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
&& apk del wget

ARG BUILD_MODE=production

ADD . /app
RUN yarn
WORKDIR /app

# Copy package files first for better caching
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Copy source code
COPY . .

# Build the application
RUN CADDY_BUILD=1 yarn build --mode ${BUILD_MODE}

########################################
# Actual webserver image
# Final webserver image
########################################
FROM caddy:2.6.4-alpine

Expand Down
2 changes: 1 addition & 1 deletion Owid.Analyzer/Owid.Analyzer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion SloCovid19Website.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ ProjectSection(SolutionItems) = preProject
vue.config.js = vue.config.js
fsharplint-config.json = fsharplint-config.json
owid.analyzer.bat = owid.analyzer.bat
base.Dockerfile = base.Dockerfile
docker-compose.test.yml = docker-compose.test.yml
docker-compose.yml = docker-compose.yml
Dockerfile = Dockerfile
Expand Down
12 changes: 0 additions & 12 deletions base.Dockerfile

This file was deleted.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"vuex": "^3.5.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.6",
"@vue/cli-plugin-babel": "~4.5.19",
"@vue/cli-plugin-eslint": "~4.5.4",
"@vue/cli-plugin-unit-jest": "~4.5.4",
"@vue/cli-service": "~4.5.4",
Expand All @@ -64,6 +64,9 @@
"vue-cli-plugin-webpack-bundle-analyzer": "~4.0.0",
"vue-template-compiler": "^2.7.14"
},
"resolutions": {
"@achrinza/node-ipc": "^10.1.11"
},
"eslintConfig": {
"root": true,
"env": {
Expand Down
6 changes: 3 additions & 3 deletions src/visualizations/App.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Components/Slider.fs" />
Expand Down Expand Up @@ -90,8 +90,8 @@
<Compile Include="Main.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fable.Browser.Dom" Version="1.2.0" />
<PackageReference Include="Fable.Browser.Event" Version="1.0.0" />
<PackageReference Include="Fable.Browser.Dom" Version="2.0.1" />
<PackageReference Include="Fable.Browser.Event" Version="1.2.1" />
<PackageReference Include="Fable.DateFunctions" Version="3.2.0" />
<PackageReference Include="Fable.Elmish.Debugger" Version="3.0.3" />
<PackageReference Include="Fable.Elmish.HMR" Version="4.0.1" />
Expand Down
1 change: 0 additions & 1 deletion src/visualizations/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<packageSources>
<clear />
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
<add key="DouglasConnect.com" value="https://baget.cloud.douglasconnect.com/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
2 changes: 1 addition & 1 deletion tests/Visualizations.Tests/Visualizations.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
Expand Down
Loading
Loading