54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
---
|
|
name: "Publish devcontainer"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: ["main"]
|
|
paths: [".devcontainer/ci/devcontainer.json"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
paths: [".devcontainer/ci/devcontainer.json"]
|
|
schedule:
|
|
- cron: "0 0 * * 1"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
publish-devcontainer:
|
|
name: Publish devcontainer
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Checkout
|
|
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
|
|
# with:
|
|
# platforms: linux/amd64,linux/arm64
|
|
|
|
- if: ${{ github.event_name != 'pull_request' }}
|
|
name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
imageName: ghcr.io/${{ github.repository }}/devcontainer
|
|
imageTag: base,latest
|
|
# platform: linux/amd64,linux/arm64
|
|
configFile: .devcontainer/ci/devcontainer.json
|
|
push: ${{ github.event_name == 'pull_request' && 'never' || 'always' }}
|