Skip to content

Commit c54ee13

Browse files
committed
feat(devcontainer): prebuilds devcontainer image
1 parent 2085cfa commit c54ee13

3 files changed

Lines changed: 93 additions & 10 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,7 @@
33
{
44
"name": "Node.js & TypeScript",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7-
"features": {
8-
"ghcr.io/devcontainers/features/common-utils:2": {},
9-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
10-
"ghcr.io/jckimble/devcontainer-features/ngrok:3": {},
11-
"ghcr.io/devcontainers/features/terraform:1": {},
12-
"ghcr.io/devcontainers/features/go:1": {},
13-
"ghcr.io/devcontainers-extra/features/cmake:1": {},
14-
"ghcr.io/devcontainers/features/aws-cli:1": {}
15-
},
6+
"image": "ghcr.io/sonikro/tf2-quickserver-devcontainer",
167
"customizations": {
178
"vscode": {
189
"extensions": [
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7+
"features": {
8+
"ghcr.io/devcontainers/features/common-utils:2": {},
9+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
10+
"ghcr.io/jckimble/devcontainer-features/ngrok:3": {},
11+
"ghcr.io/devcontainers/features/terraform:1": {},
12+
"ghcr.io/devcontainers/features/go:1": {},
13+
"ghcr.io/devcontainers-extra/features/cmake:1": {},
14+
"ghcr.io/devcontainers/features/aws-cli:1": {}
15+
},
16+
"customizations": {
17+
"vscode": {
18+
"extensions": [
19+
"vitest.explorer",
20+
"github.vscode-github-actions",
21+
"yy0931.vscode-sqlite3-editor",
22+
"Sarrus.sourcepawn-vscode",
23+
"yzhang.markdown-all-in-one"
24+
]
25+
}
26+
},
27+
"appPort": [
28+
"27100:27100/udp",
29+
"27101:27101/udp"
30+
]
31+
32+
// Features to add to the dev container. More info: https://containers.dev/features.
33+
// "features": {},
34+
35+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
36+
// "forwardPorts": [],
37+
38+
// Use 'postCreateCommand' to run commands after the container is created.
39+
// "postCreateCommand": "yarn install",
40+
41+
// Configure tool-specific properties.
42+
// "customizations": {},
43+
44+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
45+
// "remoteUser": "root"
46+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: DevContainer CI/CD
2+
3+
on:
4+
push:
5+
paths:
6+
- '.devcontainer/**'
7+
branches:
8+
- main
9+
pull_request:
10+
paths:
11+
- '.devcontainer/**'
12+
branches:
13+
- main
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Login to GitHub Container Registry
26+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Build and push Dev Container
34+
uses: devcontainers/ci@v0.3
35+
with:
36+
imageName: ghcr.io/sonikro/tf2-quickserver-devcontainer
37+
cacheFrom: ghcr.io/sonikro/tf2-quickserver-devcontainer
38+
subFolder: .github
39+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'always' || 'never' }}
40+
runCmd: |
41+
node --version
42+
npm --version
43+
terraform --version
44+
go version
45+
aws --version
46+
docker --version

0 commit comments

Comments
 (0)