Skip to content

Commit

Permalink
chore: Update devcontainer.json and Dockerfile for DevChum project
Browse files Browse the repository at this point in the history
  • Loading branch information
k-taro56 committed Jul 6, 2024
1 parent c0a62fe commit b63632b
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm

RUN npm uninstall -g pnpm && corepack enable pnpm
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "DevChum",
"build": {
"dockerfile": "Dockerfile",
"cacheFrom": "ghcr.io/nid-kt/devchum-devcontainer"
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "corepack prepare && pnpm i --frozen-lockfile",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: daily

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
20 changes: 20 additions & 0 deletions .github/workflows/ci-in-devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI in DevContainer

on:
push:
pull_request:

jobs:
ci-in-devcontainer:
runs-on: ubuntu-latest

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

- name: Export
uses: devcontainers/[email protected]
with:
cacheFrom: ghcr.io/nid-kt/devchum-devcontainer
push: never
runCmd: pnpm export
30 changes: 30 additions & 0 deletions .github/workflows/push-devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Push DevContainer

on:
push:
branches:
- main

jobs:
push-devcontainer:
runs-on: ubuntu-latest
permissions:
packages: write

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

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

- name: Push DevContainer
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/nid-kt/devchum-devcontainer
cacheFrom: ghcr.io/nid-kt/devchum-devcontainer
push: always
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}

0 comments on commit b63632b

Please sign in to comment.