Skip to content

Commit

Permalink
Add Devcontainer (#10)
Browse files Browse the repository at this point in the history
* Remove tabs from .gitmodules

Use spaces instead; we are using tabs nowhere else so why here?

* Add devcontainer
  • Loading branch information
OrionOth authored Dec 15, 2023
1 parent d4f3841 commit 40e38ba
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 5 deletions.
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "SeahawkTank",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "ghcr.io/cabrilloroboticsclub/seahawk_2:devcontainer",
// "build": { "dockerfile": "Dockerfile" },

// 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": "make devbox-install"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root",

//"runArgs": [
// "--network=host", "-v", "/dev/shm:/dev/shm"
//]
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setup/image/
46 changes: 46 additions & 0 deletions .github/workflows/build-devbox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build-devbox

on:
push:
tags:
- "devcontainer-*"
workflow_dispatch: {}

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Extract version and branch metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=raw,value=devcontainer
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./setup
file: ./setup/Dockerfile.devcontainer
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
9 changes: 5 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[submodule "setup"]
path = setup
url = ../setup.git
path = setup
url = ../setup.git
branch = seahawk_2
update = checkout
ignore = none
[submodule "source"]
path = src
url = ../ROV.git
path = src
url = ../ROV.git
update = checkout
ignore = none # maybe change this to `dirty`?

0 comments on commit 40e38ba

Please sign in to comment.