Skip to content

Commit

Permalink
ci: temp commit to test excludes
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Drew <[email protected]>
  • Loading branch information
learnitall committed Jul 31, 2024
1 parent 3c13074 commit a4e9c26
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .github/images.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"include": [
{
"name": "cmapisrv-mock",
"context": "cmapisrv-mock",
"dockerfile": "./cmapisrv-mock/Dockerfile"
},
{
"name": "scale-utils",
"context": "egw-scale-utils",
"dockerfile": "./egw-scale-utils/Dockerfile"
}
]
}
49 changes: 41 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,52 @@ on:
- main

jobs:
generate-matrix:
name: Check code changes
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}

steps:
- name: Checkout Source Code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
if: ${{ github.event_name == 'pull_request' }}
with:
persist-credentials: false

- name: Check code changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
if: ${{ github.event_name == 'pull_request' }}
id: changes
with:
filters: |
cmapisrv-mock:
- 'cmapisrv-mock/**'
scale-utils:
- 'egw-scale-utils/**'
- name: Generate matrix
id: generate-matrix
run: |
if [[ "${{ github.event_name }}" == 'push' ]]; then
echo "matrix=$(jq -c . ./.github/images.json)"" >> $GITHUB_OUTPUT
exit 0
fi
jq -c '{"include": [ .[] | select(any(.name == ${{ steps.changes.outputs.changes }}[]; .)) ]}' > /tmp/matrix.json
echo "Generated matrix"
cat /tmp/matrix.json
echo "matrix=$(jq -c '.' /tmp/matrix.json)" >> $GITHUB_OUTPUT
build-and-push:
name: Build and Push
runs-on: ubuntu-latest
needs: generate-matrix

strategy:
matrix:
include:
- name: cmapisrv-mock
context: cmapisrv-mock
dockerfile: ./cmapisrv-mock/Dockerfile
- name: scale-utils
context: egw-scale-utils
dockerfile: ./egw-scale-utils/Dockerfile
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}

steps:
- name: Set up Docker Buildx
Expand Down

0 comments on commit a4e9c26

Please sign in to comment.