Skip to content

adding dev container config #13

adding dev container config

adding dev container config #13

Workflow file for this run

name: Dev Container Build and Push Image
on:
workflow_dispatch:
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_request:
branches: [main]
jobs:
build-and-push:
strategy:
fail-fast: false
matrix:
os:
- [ubuntu-latest]
- [ macos-13 ]
runs-on: ${{ matrix.os }}
steps:
-
name: Checkout
id: checkout
uses: actions/checkout@v1
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker docker-buildx
brew install colima
colima start
while ! docker info >/dev/null 2>&1; do sleep 1; done
mkdir -p ~/.docker/cli-plugins
ln -sfn $(which docker-buildx) ~/.docker/cli-plugins/docker-buildx
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
-
name: Build Dev Container Image
uses: devcontainers/[email protected]
with:
subFolder: .github
imageName: ghcr.io/${{ github.repository }}
cacheFrom: ghcr.io/${{ github.repository }}
push: never
- name: Test Container Image
run: |
docker run --rm ghcr.io/${{ github.repository }} /bin/bash -c "git clone -b devContainers https://github.com/drifter089/pypsa-earth.git && cd pypsa-earth && bash .github/.devcontainer/test.sh"
- name: Push Container Image
if: ${{ success() }}
run: |
docker push ghcr.io/${{ github.repository }}