Skip to content

Commit

Permalink
switch devcontainer build to use devcontainer/ci action
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Oct 31, 2024
1 parent ecab466 commit 08e8d4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
11 changes: 6 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
// Uncomment this and comment "image" out for local devcontainer building.
// "build": {
// "dockerfile": "Dockerfile",
// "context": "../"
// },
"image": "ghcr.io/nrel/buildingmotif/devcontainer:ts-devcontainers",
"build": {
"dockerfile": "Dockerfile",
"context": "../",
"cacheFrom": "ghcr.io/nrel/buildingmotif/devcontainer:ts-devcontainers"
},
// "image": "ghcr.io/nrel/buildingmotif/devcontainer:ts-devcontainers",
"runArgs": ["--net=host"], // Use host network for webapp (which only listens for localhost by default)
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,11 @@ jobs:
type=sha
type=edge
- name: Build and push
uses: docker/build-push-action@v6
- name: Pre-build dev container image
uses: devcontainers/[email protected]
with:
context: .
file: .devcontainer/Dockerfile
push: true
target: devcontainer
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.output.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
imageName: ${{ env.REGISTRY }}/${{ github.repository }}/devcontainer:ts-devcontainers
imageTag: ${{ steps.meta.outputs.tags }}
cacheFrom: ${{ env.REGISTRY }}/${{ github.repository }}/devcontainer:ts-devcontainers
push: always
platform: linux/amd64,linux/arm64

0 comments on commit 08e8d4b

Please sign in to comment.