Skip to content

Commit

Permalink
feat: pre-build dev container workflow (#1)
Browse files Browse the repository at this point in the history
Configures a GitHub Actions workflow which will pre-build a dev container for this project
  • Loading branch information
jwbennet authored Jan 27, 2024
1 parent 080fd1c commit 1fceb55
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/.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
{
"name": "Dev Container",
"image": "mcr.microsoft.com/devcontainers/base:jammy",

"features": {
"ghcr.io/devcontainers-contrib/features/copier": {
"version": "9.1.1",
},
"ghcr.io/devcontainers-contrib/features/go-task": {
"version": "3.33.1",
},
"ghcr.io/devcontainers-contrib/features/mkdocs": {
"version": "1.5.3",
},
"ghcr.io/devcontainers/features/node": {
"version": "20.11.0",
},
"ghcr.io/devcontainers-contrib/features/pre-commit": {
"version": "3.6.0",
},
"ghcr.io/devcontainers/features/python": {
"version": "3.12.1",
},
},

"customizations": {
"vscode": {
"extensions": ["EditorConfig.EditorConfig", "redhat.vscode-yaml"],
},
},
}
32 changes: 32 additions & 0 deletions .github/.devcontainer/workflows/devcontainer-build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dev Container Build and Push Image

on:
workflow_dispatch:
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_requests:
branches:
- "main"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pre-build dev container image
uses: devcontainers/ci@v0.2
with:
subFolder: .github
imageName: ghcr.io/${{ github.repository }}
cacheFrom: ghcr.io/${{ github.repository }}
push: always

0 comments on commit 1fceb55

Please sign in to comment.