Skip to content

chore: Dev Containersにキャッシュがかかるように変更 #2

chore: Dev Containersにキャッシュがかかるように変更

chore: Dev Containersにキャッシュがかかるように変更 #2

Workflow file for this run

name: Devcontainer CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: programming-grading-system-devcontainer
jobs:
changes:
name: Changes
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
outputs:
dockerfile: ${{ steps.changes.outputs.dockerfile }}
workflows: ${{ steps.changes.outputs.workflows }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Check Dockerfile files changed
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
dockerfile:
- 'Dockerfile'
workflows:
- '.github/workflows/devcontainer-ci.yml'
build:
name: Build and push Docker image
runs-on: ubuntu-24.04
needs: changes
if: needs.changes.outputs.dockerfile == 'true' || needs.changes.outputs.workflows == 'true'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and run dev container task
uses: devcontainers/ci@a56d055efecd725e8cfe370543b6071b79989cc8
with:
push: always
imageName: ghcr.io/${{ github.repository }}-devcontainer