setup dev containers again

This commit is contained in:
41666 2020-12-03 12:56:12 -05:00
parent c23b84c4fa
commit 80db505a11
3 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{
"name": "Roleypoly (Go, Node)",
"image": "ghcr.io/roleypoly/dev-container:main",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"golang.go",
"hashicorp.terraform",
"firsttris.vscode-jest-runner",
"esbenp.prettier-vscode",
"jpoissonnier.vscode-styled-components",
"eg2.vscode-npm-script",
"christian-kohler.npm-intellisense",
"ms-azuretools.vscode-docker",
"eamodio.gitlens",
"davidanson.vscode-markdownlint",
"stylelint.vscode-stylelint",
"pflannery.vscode-versionlens",
"visualstudioexptteam.vscodeintellicode",
"bungcip.better-toml"
],
// 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": "uname -a",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

53
.github/workflows/dev-container.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Dev Container
on:
push:
paths:
- hack/dockerfiles/dev-container.Dockerfile
- .github/workflows/dev-container.yml
schedule:
- cron: '0 12 * * 2' # 12 noon every tuesday
jobs:
docker_build:
name: Docker Build & Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/roleypoly/dev-container
tag-sha: true
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: roleypoly
password: ${{ secrets.GHCR_PAT }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./hack/dockerfiles/dev-container.Dockerfile
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

View file

@ -0,0 +1,8 @@
FROM mcr.microsoft.com/vscode/devcontainers/go:1.15
# Install Node.js
ARG NODE_VERSION="lts/*"
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
# Install Wrangler
RUN su vscode -c "npm install -g wrangler"