chore: use specific dockerignore file with optimized image build trig… #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DevContainer | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
dev-container-publish: | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
- name: Build and push dev container | |
env: | |
SOURCE_DATE_EPOCH: 0 | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 | |
with: | |
build-args: | | |
PYTHON_VERSION=${{ matrix.python-version }} | |
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }} | |
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }},mode=max | |
file: .devcontainer/Dockerfile | |
provenance: false | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }} | |
target: dev | |
strategy: | |
matrix: | |
python-version: | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .devcontainer/Dockerfile | |
- .devcontainer/Dockerfile.dockerignore | |
- .github/workflows/devcontainer.yml | |
workflow_dispatch: null |