diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eb181877..44990939 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,16 +3,7 @@ { "name": "Node.js & TypeScript", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm", - "features": { - "ghcr.io/devcontainers/features/common-utils:2": {}, - "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, - "ghcr.io/jckimble/devcontainer-features/ngrok:3": {}, - "ghcr.io/devcontainers/features/terraform:1": {}, - "ghcr.io/devcontainers/features/go:1": {}, - "ghcr.io/devcontainers-extra/features/cmake:1": {}, - "ghcr.io/devcontainers/features/aws-cli:1": {} - }, + "image": "ghcr.io/sonikro/tf2-quickserver-devcontainer", "customizations": { "vscode": { "extensions": [ diff --git a/.github/.devcontainer/devcontainer.json b/.github/.devcontainer/devcontainer.json new file mode 100644 index 00000000..eb181877 --- /dev/null +++ b/.github/.devcontainer/devcontainer.json @@ -0,0 +1,46 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/jckimble/devcontainer-features/ngrok:3": {}, + "ghcr.io/devcontainers/features/terraform:1": {}, + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/devcontainers-extra/features/cmake:1": {}, + "ghcr.io/devcontainers/features/aws-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "vitest.explorer", + "github.vscode-github-actions", + "yy0931.vscode-sqlite3-editor", + "Sarrus.sourcepawn-vscode", + "yzhang.markdown-all-in-one" + ] + } + }, + "appPort": [ + "27100:27100/udp", + "27101:27101/udp" + ] + + // 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": "yarn install", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/devcontainer.yaml b/.github/workflows/devcontainer.yaml new file mode 100644 index 00000000..8c528c0b --- /dev/null +++ b/.github/workflows/devcontainer.yaml @@ -0,0 +1,46 @@ +name: DevContainer CI/CD + +on: + push: + paths: + - '.github/.devcontainer/**' + branches: + - main + pull_request: + paths: + - '.github/.devcontainer/**' + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to GitHub Container Registry + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Dev Container + uses: devcontainers/ci@v0.3 + with: + imageName: ghcr.io/sonikro/tf2-quickserver-devcontainer + cacheFrom: ghcr.io/sonikro/tf2-quickserver-devcontainer + subFolder: .github + push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'always' || 'never' }} + runCmd: | + node --version + npm --version + terraform --version + go version + aws --version + docker --version