|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: [master, develop] |
6 | | - pull_request: |
7 | | - branches: [master] |
8 | | - schedule: |
9 | | - - cron: '0 13 */15 * *' |
10 | | - workflow_dispatch: |
11 | | - inputs: |
12 | | - force_run: |
13 | | - description: 'Force workflow run' |
14 | | - required: true |
15 | | - type: choice |
16 | | - options: [yes, no] |
| 4 | + workflow_call: |
17 | 5 |
|
18 | 6 | permissions: |
19 | 7 | actions: read |
20 | 8 | contents: read |
21 | 9 | statuses: write |
22 | 10 |
|
23 | | -concurrency: |
24 | | - group: ${{ github.workflow }}-${{ github.ref }} |
25 | | - cancel-in-progress: true |
26 | | - |
27 | 11 | jobs: |
28 | 12 | Go: |
29 | 13 | name: Go |
@@ -121,59 +105,3 @@ jobs: |
121 | 105 | - name: Check spelling |
122 | 106 | continue-on-error: true |
123 | 107 | uses: crate-ci/typos@master |
124 | | - |
125 | | - DockerBuild: |
126 | | - name: Docker Build Check |
127 | | - runs-on: ubuntu-latest |
128 | | - |
129 | | - needs: [Hadolint, Perfecto, Aligo] |
130 | | - |
131 | | - env: |
132 | | - REGISTRY: ghcr.io |
133 | | - |
134 | | - strategy: |
135 | | - matrix: |
136 | | - image: [ 'alpine' ] |
137 | | - |
138 | | - steps: |
139 | | - - name: Check event type |
140 | | - run: | |
141 | | - if [[ "${{github.event_name}}" != "pull_request" ]] ; then |
142 | | - echo "::notice::Event type is not 'pull_request', all job actions will be skipped" |
143 | | - fi |
144 | | -
|
145 | | - # This step is a hack for needs+if issue with actions |
146 | | - # More info about issue: https://github.com/actions/runner/issues/491 |
147 | | -
|
148 | | - - name: Checkout |
149 | | - uses: actions/checkout@v4 |
150 | | - if: ${{ github.event_name == 'pull_request' }} |
151 | | - |
152 | | - - name: Login to DockerHub |
153 | | - uses: docker/login-action@v3 |
154 | | - env: |
155 | | - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} |
156 | | - if: ${{ github.event_name == 'pull_request' && env.DOCKERHUB_USERNAME != '' }} |
157 | | - with: |
158 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
159 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
160 | | - |
161 | | - - name: Login to GitHub Container Registry |
162 | | - uses: docker/login-action@v3 |
163 | | - if: ${{ github.event_name == 'pull_request' }} |
164 | | - with: |
165 | | - registry: ghcr.io |
166 | | - username: ${{ github.actor }} |
167 | | - password: ${{ secrets.GITHUB_TOKEN }} |
168 | | - |
169 | | - - name: Build Docker image |
170 | | - if: ${{ github.event_name == 'pull_request' }} |
171 | | - run: | |
172 | | - docker build --build-arg REGISTRY=${REGISTRY} -f .docker/${{matrix.image}}.docker -t ${{matrix.image}} . |
173 | | -
|
174 | | - - name: Show info about built Docker image |
175 | | - uses: essentialkaos/docker-info-action@v1 |
176 | | - if: ${{ github.event_name == 'pull_request' }} |
177 | | - with: |
178 | | - image: ${{matrix.image}} |
179 | | - show-labels: true |
0 commit comments