|
| 1 | +--- |
| 2 | + |
| 3 | +name: 'CI' |
| 4 | + |
| 5 | + |
| 6 | +on: |
| 7 | + # workflow_call: |
| 8 | + # inputs: |
| 9 | + # build-branch: # tag / dev |
| 10 | + # required: true |
| 11 | + # type: string |
| 12 | + push: |
| 13 | + branches: |
| 14 | + - '**' |
| 15 | + tags: |
| 16 | + - '*' |
| 17 | + pull_request: |
| 18 | + branches: |
| 19 | + - '**' |
| 20 | + |
| 21 | + |
| 22 | +# env: |
| 23 | +# DOCKER_BUILD_IMAGE: "ghcr.io/${{ github.repository }}-fred:${{ github.sha }}" |
| 24 | + |
| 25 | + |
| 26 | +# permissions: |
| 27 | +# pull-requests: write |
| 28 | +# contents: read |
| 29 | +# actions: read |
| 30 | +# checks: write |
| 31 | +# packages: write |
| 32 | +# security-events: write |
| 33 | +# statuses: write |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +jobs: |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + docker-changed: |
| 42 | + if: |
| 43 | + ( |
| 44 | + github.event.pull_request |
| 45 | + || |
| 46 | + github.event.push |
| 47 | + || |
| 48 | + github.ref_type == 'tag' |
| 49 | + ) |
| 50 | + runs-on: ubuntu-latest |
| 51 | + name: Docker Test |
| 52 | + outputs: |
| 53 | + feature: ${{ steps.changes-feature.outputs.src }} |
| 54 | + development: ${{ steps.changes-development.outputs.src }} |
| 55 | + steps: |
| 56 | + |
| 57 | + |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + |
| 60 | + |
| 61 | + - uses: dorny/paths-filter@v2 |
| 62 | + name: Development Changes |
| 63 | + if: |
| 64 | + ( |
| 65 | + github.ref_name == 'development' |
| 66 | + ) |
| 67 | + id: changes-development |
| 68 | + with: |
| 69 | + # base: master |
| 70 | + ref: master |
| 71 | + filters: | |
| 72 | + src: |
| 73 | + - '.github/workflows/docker.yaml' |
| 74 | +
|
| 75 | +
|
| 76 | + - uses: dorny/paths-filter@v2 |
| 77 | + name: Feature Branch |
| 78 | + if: |
| 79 | + ( |
| 80 | + github.ref_name != 'development' |
| 81 | + && |
| 82 | + github.ref_name != 'master' |
| 83 | + ) |
| 84 | + id: changes-feature |
| 85 | + with: |
| 86 | + # base: development |
| 87 | + ref: development |
| 88 | + filters: | |
| 89 | + src: |
| 90 | + - '.github/workflows/docker.yaml' |
| 91 | +
|
| 92 | + - name: Debug |
| 93 | + if: |
| 94 | + ( |
| 95 | + steps.changes-feature.outputs.src == 'true' |
| 96 | + || |
| 97 | + steps.changes-development.outputs.src == 'true' |
| 98 | + || |
| 99 | + needs.changes-feature.outputs |
| 100 | + ) |
| 101 | + run: |
| 102 | + echo "**********************************************************"; |
| 103 | + echo ${{ steps.changes-feature.outputs }}; |
| 104 | + |
| 105 | + echo ""; |
| 106 | + echo "**********************************************************"; |
| 107 | + echo ""; |
| 108 | + |
| 109 | + echo ${{ steps.changes-development.outputs }}; |
| 110 | + |
| 111 | + echo ""; |
| 112 | + echo "**********************************************************"; |
| 113 | + |
| 114 | + |
| 115 | + docker-check: |
| 116 | + needs: docker-changed |
| 117 | + name: 'Docker' |
| 118 | + if: |
| 119 | + ( |
| 120 | + needs.outputs.feature == 'true' |
| 121 | + || |
| 122 | + needs.outputs.development == 'true' |
| 123 | + ) |
| 124 | + uses: ./.github/workflows/docker.yaml |
| 125 | + with: |
| 126 | + DOCKER_BUILD_IMAGE_NAME: "workflow-docker" |
| 127 | + DOCKER_PUBLISH_IMAGE_NAME: "workflow-docker-publish" |
| 128 | + DOCKER_PUBLISH_REGISTRY: "ghcr.io" |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + # release: |
| 133 | + # name: 'Release' |
| 134 | + # uses: nofusscomputing/scratchpad/.github/workflows/release.yaml@further-testing |
| 135 | + # # with: |
| 136 | + # # DOCKER_BUILD_IMAGE_NAME: "${{ github.repository }}" |
0 commit comments