Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: prebuild dev containers #2184

Merged
merged 21 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
73 changes: 73 additions & 0 deletions .devcontainer/devcontainer-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "Dash Platform Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"arcanis.vscode-zipfs",
"chrmarti.regex",
"davidanson.vscode-markdownlint",
"ms-vscode.cmake-tools",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"vadimcn.vscode-lldb",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"zhangyue.rust-mod-generator",
"ms-azuretools.vscode-docker"
]
}
},
"remoteUser": "vscode",
"mounts": [
{
"source": "devcontainer-platform-cargo-registry-index-${devcontainerId}",
"target": "/home/vscode/.cargo/registry",
"type": "volume"
},
{
"source": "devcontainer-platform-cargo-registry-cache-${devcontainerId}",
"target": "/home/vscode/.cargo/registry/cache",
"type": "volume"
},
{
"source": "devcontainer-platform-cargo-git-db-${devcontainerId}",
"target": "/home/vscode/.cargo/git/db",
"type": "volume"
},
{
"source": "devcontainer-platform-target-${devcontainerId}",
"target": "${containerWorkspaceFolder}/target",
"type": "volume"
}
],
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {
"version": 20,
"installYarnUsingApt": false
},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/schlich/devcontainer-features/starship:0": {},
},
"postCreateCommand": {
"git-safe": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"cargo-permissions": "sudo chown -R vscode:vscode /home/vscode/.cargo ${containerWorkspaceFolder}/target"
}
}
72 changes: 1 addition & 71 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,4 @@
{
"name": "Dash Platform Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"arcanis.vscode-zipfs",
"chrmarti.regex",
"davidanson.vscode-markdownlint",
"arcanis.vscode-zipfs",
"ms-vscode.cmake-tools",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"vadimcn.vscode-lldb",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"zhangyue.rust-mod-generator",
"ms-azuretools.vscode-docker"
]
}
},
"remoteUser": "vscode",
"mounts": [
{
"source": "devcontainer-platform-cargo-registry-index-${devcontainerId}",
"target": "/home/vscode/.cargo/registry",
"type": "volume"
},
{
"source": "devcontainer-platform-cargo-registry-cache-${devcontainerId}",
"target": "/home/vscode/.cargo/registry/cache",
"type": "volume"
},
{
"source": "devcontainer-platform-cargo-git-db-${devcontainerId}",
"target": "/home/vscode/.cargo/git/db",
"type": "volume"
},
{
"source": "devcontainer-platform-target-${devcontainerId}",
"target": "${containerWorkspaceFolder}/target",
"type": "volume"
}
],
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {
"version": 20,
"installYarnUsingApt": false,
},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/schlich/devcontainer-features/starship:0": {},
},
"postCreateCommand": {
"git-safe": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"cargo-permissions": "sudo chown -R vscode:vscode /home/vscode/.cargo ${containerWorkspaceFolder}/target"
}
"image": "ghcr.io/dashpay/platform/devcontainer:latest"
shumkov marked this conversation as resolved.
Show resolved Hide resolved
}
40 changes: 40 additions & 0 deletions .github/workflows/prebuild-devcontainers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Prebuild Dev Containers

on:
schedule:
- cron: "0 0 * * *"
push:
paths:
- '.devcontainer/**'
- '.github/workflows/prebuild-devcontainers.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up QEMU for multi-architecture builds
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx for multi-architecture builds
uses: docker/setup-buildx-action@v3
with:
use: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: dashpay
password: ${{ secrets.GITHUB_TOKEN }}
shumkov marked this conversation as resolved.
Show resolved Hide resolved

- name: Build and push Platform devcontainer
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/dashpay/platform/devcontainer
platform: linux/amd64,linux/arm64
configFile: .devcontainer/devcontainer-build.json
push: true
cacheFrom: ghcr.io/dashpay/platform/devcontainer
Loading