Skip to content

push only on main

push only on main #48

Workflow file for this run

name: devcontainer
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '.devcontainer/**'
- '.vscode/**'
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '.devcontainer/**'
- '.vscode/**'
- '**.md'
schedule:
- cron: '0 0 * * 0'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
actions: write
steps:
-
name: Git Checkout
uses: actions/checkout@v4
id: git
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
id: qemu
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
-
name: Login to GitHub Container Registry
id: login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build Dev Container Image
uses: docker/build-push-action@v5
with:
push: false
load: true
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
tags: 'ghcr.io/${{ github.repository_owner }}/devcontainer:latest'
-
name: Push Dev Container Image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
push: true
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
tags: 'ghcr.io/${{ github.repository_owner }}/devcontainer:latest'