-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.4 KB
/
build.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
name: Build Image
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- asdf
- node-20.13-playwright
- ruby-3.2.2-postgres-16.1
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
image:
- 'build-images/${{ matrix.image }}.Dockerfile'
- 'build-images/${{ matrix.image }}/**'
- '.github/workflows/build.yml'
- run: >-
docker build
-t ghcr.io/code0-tech/build-images/${{ matrix.image }}:${{ github.run_number }}.${{ github.run_attempt }}
-f build-images/${{ matrix.image }}.Dockerfile
.
if: steps.filter.outputs.image == 'true'
- run: echo ${{ secrets.GITHUB_TOKEN }} | docker login -u $ --password-stdin ghcr.io
name: Login to registry
if: ${{ (github.event_name == 'push' && steps.filter.outputs.image == 'true') || github.event_name == 'workflow_dispatch' }}
- run: docker push ghcr.io/code0-tech/build-images/${{ matrix.image }}:${{ github.run_number }}.${{ github.run_attempt }}
if: ${{ (github.event_name == 'push' && steps.filter.outputs.image == 'true') || github.event_name == 'workflow_dispatch' }}