diff --git a/.github/workflows/build-devcontainer.yml b/.github/workflows/build-devcontainer.yml index 99f11cb..87ca677 100644 --- a/.github/workflows/build-devcontainer.yml +++ b/.github/workflows/build-devcontainer.yml @@ -12,6 +12,7 @@ on: - main paths: - '.devcontainer/**' + - '.github/workflows/build-devcontainer.yml' workflow_dispatch: env: @@ -31,6 +32,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Read VSCODE_COMMIT from devcontainer.json + id: vscode-commit + run: | + VSCODE_COMMIT=$(grep 'VSCODE_COMMIT' .devcontainer/devcontainer.json | tr -d '"' | cut -d " " -f 2) + VSCODE_SHORT=${VSCODE_COMMIT:0:7} + echo "vscode_commit=$VSCODE_COMMIT" >> $GITHUB_OUTPUT + echo "vscode_short=$VSCODE_SHORT" >> $GITHUB_OUTPUT + echo "Full VSCODE_COMMIT: $VSCODE_COMMIT" + echo "Short VSCODE_COMMIT: $VSCODE_SHORT" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -52,6 +63,8 @@ jobs: type=ref,event=tag type=sha,prefix={{branch}}-,enable={{is_default_branch}} type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=vscode-${{ steps.vscode-commit.outputs.vscode_short }} + type=raw,value=vscode-${{ steps.vscode-commit.outputs.vscode_short }}-{{sha}} - name: Extract tag names only id: tags @@ -136,6 +149,8 @@ jobs: echo "🏷️ Image: ${{ env.IMAGE_NAME }}" echo "🆔 Tags: ${{ steps.meta.outputs.tags }}" echo "📝 Labels: ${{ steps.meta.outputs.labels }}" + echo "🔧 VSCode Commit: ${{ steps.vscode-commit.outputs.vscode_commit }}" + echo "📋 Short Commit: ${{ steps.vscode-commit.outputs.vscode_short }}" echo "" echo "To use this dev container:" echo "1. Reference it in your devcontainer.json:" diff --git a/README.md b/README.md index dc34d35..ad06e5c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ This dev container is automatically built and published to GitHub Container Regi - `main` - Latest build from main branch - `main-` - Specific commit builds from main branch - `pr-` - Pull request builds for testing + - `vscode-` - Builds with specific VS Code versions + - `vscode--` - Combination of VS Code and git commit **Recommended**: Use `latest` for stable deployments or `main-` for reproducible builds. @@ -64,6 +66,7 @@ This includes: - **Base**: Ubuntu 24.04 (Noble) via Microsoft's devcontainers base image - **Python**: System Python with development tools (via devcontainer feature) +- **R**: Full R language support with development tools (via Rocker Project devcontainer feature) - **Git**: Latest version with configuration support - **Shell**: Zsh with Oh My Zsh (via common-utils feature) - **Quarto**: Document publishing platform (latest version) @@ -77,6 +80,21 @@ This includes: - Rainbow CSV - **VS Code Server**: Pre-installed for immediate development +## 📊 R Language Support + +This dev container includes comprehensive R language support through the [Rocker Project's devcontainer features](https://github.com/rocker-org/devcontainer-features). The R feature provides: + +### Features Available +- **R Installation**: Latest R version via apt package manager +- **Development Tools**: devtools, renv for package management +- **IDE Integration**: + - languageserver package for VS Code R extension support + - httpgd package for interactive graphics + - rmarkdown for document generation +- **Jupyter Integration**: R kernel for Jupyter notebooks +- **Interactive Console**: radian (enhanced R console with syntax highlighting) +- **Debugging Support**: vscDebugger package for VS Code R debugging + ## ⚙️ VS Code Server The container comes with VS Code Server pre-installed for immediate development. For TRE-specific VS Code Server configuration, see the [SDF TRE Setup Guide](SDF_TRE_SETUP.md). @@ -94,6 +112,7 @@ The container is built automatically with smart tagging: - **Main Branch Pushes**: Creates `latest`, `main`, and `main-` tags - **Pull Requests**: Creates `pr-` tags for testing +- **VS Code Commits**: Creates `vscode-` and `vscode--` tags - **Manual Dispatch**: Available for on-demand builds - **Platform**: linux/amd64 optimized for development speed @@ -101,3 +120,5 @@ The container is built automatically with smart tagging: - Use `latest` for the most recent stable release - Use `main-` when you need reproducible builds - Use `pr-` tags to test specific pull request changes +- Use `vscode-` tags to match specific VS Code versions +- Use `vscode--` tags for a combination of VS Code and git commits