Skip to content

Build and push devcontainer image #3

Build and push devcontainer image

Build and push devcontainer image #3

name: Build and push devcontainer image
on:
push:
branches: [main, master]
paths:
- '.devcontainer/Dockerfile'
- '.devcontainer/start-vnc.sh'
- '.github/workflows/build-devcontainer.yml'
schedule:
- cron: '0 4 * * 0'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: biodynamo/demo
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,prefix=
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .devcontainer/
file: .devcontainer/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}