Skip to content

Ass osc dev container #2

Ass osc dev container

Ass osc dev container #2

Workflow file for this run

name: Dev Container CI
on:
push:
paths:
- '.github/workflows/osc.yml'
- 'osc/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup dev container
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
npm install --global @devcontainers/cli
- name: Setup container registry credentials
env:
CONTAINER_REGISTRY_NAMESPACE: ${{ secrets.CONTAINER_REGISTRY_NAMESPACE }}
CONTAINER_REGISTRY_USERNAME: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
CONTAINER_REGISTRY_TOKEN: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
docker login "$CONTAINER_REGISTRY_NAMESPACE" \
--username "$CONTAINER_REGISTRY_USERNAME" \
--password-stdin <<< "$CONTAINER_REGISTRY_TOKEN"
- name: Build dev container
env:
CONTAINER_REGISTRY_NAMESPACE: ${{ secrets.CONTAINER_REGISTRY_NAMESPACE }}
CONTAINER_REGISTRY_USERNAME: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
run: |
cd osc
devcontainer build \
--workspace-folder . \
--image-name "$CONTAINER_REGISTRY_NAMESPACE/$CONTAINER_REGISTRY_USERNAME/devcontainer-osc:latest"
- name: Push dev container
env:
CONTAINER_REGISTRY_NAMESPACE: ${{ secrets.CONTAINER_REGISTRY_NAMESPACE }}
CONTAINER_REGISTRY_USERNAME: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
docker image push --all-tags "$CONTAINER_REGISTRY_NAMESPACE/$CONTAINER_REGISTRY_USERNAME/devcontainer-osc"