-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.71 KB
/
devcontainer-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Devcontainer CI
on:
push:
branches:
- main
workflow_dispatch:
jobs:
changes:
name: Changes
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
outputs:
dockerfile: ${{ steps.changes.outputs.dockerfile }}
tool-versions: ${{ steps.changes.outputs.tool-versions }}
workflows: ${{ steps.changes.outputs.workflows }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Check Dockerfile files changed
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
dockerfile:
- 'Dockerfile'
tool-versions:
- '.tool-versions'
workflows:
- '.github/workflows/devcontainer-ci.yml'
build:
name: Build and push Docker image
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
needs: changes
if: needs.changes.outputs.dockerfile == 'true' || needs.changes.outputs.tool-versions == 'true' || needs.changes.outputs.workflows == 'true'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Login to GitHub Container Registry
uses: docker/login-action@7ca345011ac4304463197fac0e56eab1bc7e6af0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and run dev container task
uses: devcontainers/ci@a56d055efecd725e8cfe370543b6071b79989cc8
with:
imageName: ghcr.io/${{ github.repository }}-devcontainer
imageTag: ${{ github.ref_name }}