|
27 | 27 | - name: Analysing the code with pylint
|
28 | 28 | run: |
|
29 | 29 | pylint $(git ls-files '*.py')
|
| 30 | + docker: |
| 31 | + name: Build Docker Image |
| 32 | + needs: lint |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Checkout |
| 36 | + uses: actions/checkout@v4 |
| 37 | + |
| 38 | + - name: Convert repository name ot image name |
| 39 | + id: image_name |
| 40 | + run: | |
| 41 | + sed -E -e 's/docker-//' -e 's/^/image_name=/' <<<"${{ github.repository }}" >> "$GITHUB_OUTPUT" |
| 42 | +
|
| 43 | + - name: Generate Docker tag names |
| 44 | + id: meta |
| 45 | + uses: docker/metadata-action@v5 |
| 46 | + with: |
| 47 | + # list of Docker images to use as base name for tags |
| 48 | + images: | |
| 49 | + ghcr.io/${{ steps.image_name.outputs.image_name }} |
| 50 | + ${{ steps.image_name.outputs.image_name }} |
| 51 | + # generate Docker tags based on the following events/attributes |
| 52 | + tags: | |
| 53 | + # set edge tag for default branch |
| 54 | + type=edge,enable={{is_default_branch}} |
| 55 | + # set dev tag for dev branch |
| 56 | + type=raw,value=dev,enable=${{ github.ref == format('refs/heads/{0}', 'dev') }},branch=dev |
| 57 | + # Tags for non SemVer tag names |
| 58 | + type=match,pattern=([0-9]+.*),group=1 |
| 59 | + # latest tag for any tags |
| 60 | + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }},event=tag |
| 61 | +
|
| 62 | + - name: Set up QEMU |
| 63 | + uses: docker/setup-qemu-action@v3 |
| 64 | + |
| 65 | + - name: Set up Docker Buildx |
| 66 | + uses: docker/setup-buildx-action@v3 |
| 67 | + |
| 68 | + - name: Build |
| 69 | + uses: docker/build-push-action@v5 |
| 70 | + with: |
| 71 | + context: . |
| 72 | + platforms: linux/arm/v7,linux/arm64/v8,linux/amd64 |
| 73 | + push: false |
| 74 | + tags: ${{ steps.meta.outputs.tags }} |
0 commit comments