add pre-commit and reorganize dockerfile #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: devcontainer | |
on: | |
push: | |
branches: | |
- 'ts/devcontainers' | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build-image: | |
name: Build image | |
runs-on: ubuntu-latest | |
# timeout-minutes: 40 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pre-build dev container image | |
run: | | |
sudo apt-get install -y --no-install-recommends npm | |
npm install -g @devcontainers/cli | |
devcontainer build --workspace-folder . --image-name ghcr.io/nrel/buildingmotif/devcontainer --platform linux/amd64,linux/arm64 --push |