-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (44 loc) · 1.55 KB
/
buildDockerBuildEnv.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
name: Build Docker Build Env
on:
push:
# Builds should happen on feature branches
# Only successfully tested builds should be merged to main
# We don't want to rebuild after testing and verifying
branches-ignore:
- 'main'
paths:
- '.github/workflows/buildDockerBuildEnv.yml'
- 'dockerBuildEnv/*'
workflow_dispatch:
jobs:
dockerBuild:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- 'arch'
- 'clang'
- 'gcc'
env:
defaultBranch: ${{ github.event.repository.default_branch }}
steps:
- uses: actions/checkout@v4
- name: Fetch default branch
run: |
git remote set-branches --add origin "${defaultBranch}"
git fetch --depth 1 origin "${defaultBranch}"
- name: Check for changes
id: diff
run: |
set +e
git diff --exit-code --no-patch "origin/${defaultBranch}" dockerBuildEnv/makefile dockerBuildEnv/nas2d-${{ matrix.platform }}.* ; echo "modified=$?" >> $GITHUB_OUTPUT
- name: Docker build
if: ${{ fromJSON(steps.diff.outputs.modified) }}
run: echo make build-image-${{ matrix.platform }}
# - name: Docker login
# if: ${{ fromJSON(steps.diff.outputs.modified) }}
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username "${{ github.repository_owner }}" --password-stdin
# - name: Docker push
# if: ${{ fromJSON(steps.diff.outputs.modified) }}
# run: make push-image-${{ matrix.platform }}