|
1 | 1 | # This file is part of AsicVerifier and is released under
|
2 | 2 | # the AGPL-3.0-only License: https://opensource.org/license/agpl-v3/
|
3 | 3 |
|
4 |
| -name: Python |
| 4 | +name: CI/CD |
5 | 5 | on:
|
6 | 6 | pull_request:
|
7 | 7 | push:
|
|
80 | 80 | env:
|
81 | 81 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
82 | 82 | - name: Test coverage must be 100% passed!
|
83 |
| - if: |
84 |
| - github.ref_type == 'tag' || |
85 |
| - github.event_name == 'pull_request' || |
86 |
| - contains('refs/heads/main refs/heads/develop', github.ref) || |
87 |
| - startsWith(github.ref, 'refs/heads/release/') || |
88 |
| - startsWith(github.ref, 'refs/heads/hotfix/') |
89 | 83 | run: if [ "$(python -m coverage json -q -o /dev/stdout | jq .totals.percent_covered)" = "100" ]; then exit; else exit 1; fi
|
90 | 84 | pypi:
|
91 | 85 | name: PyPI
|
@@ -115,3 +109,45 @@ jobs:
|
115 | 109 | uses: pypa/gh-action-pypi-publish@release/v1
|
116 | 110 | with:
|
117 | 111 | skip-existing: true
|
| 112 | + docker: |
| 113 | + name: Docker |
| 114 | + needs: pypi |
| 115 | + if: echo ${{ github.ref }} | egrep '^refs/tags/[0-9]+.[0-9]+.[0-9]+$' |
| 116 | + runs-on: ubuntu-latest |
| 117 | + environment: |
| 118 | + name: docker |
| 119 | + url: https://hub.docker.com/r/${{ github.repository }} |
| 120 | + steps: |
| 121 | + - name: Checkout |
| 122 | + uses: actions/checkout@v4 |
| 123 | + with: |
| 124 | + fetch-depth: 0 |
| 125 | + - name: Set up Docker Buildx |
| 126 | + uses: docker/setup-buildx-action@v3 |
| 127 | + with: |
| 128 | + driver: docker |
| 129 | + - name: Login to Docker Hub |
| 130 | + uses: docker/login-action@v3 |
| 131 | + with: |
| 132 | + username: ${{ github.repository_owner }} |
| 133 | + password: ${{ secrets.TOKEN }} |
| 134 | + - name: Build and push image |
| 135 | + uses: docker/build-push-action@v5 |
| 136 | + with: |
| 137 | + context: . |
| 138 | + platforms: linux/amd64 |
| 139 | + cache-from: | |
| 140 | + type=registry,ref=${{ github.repository }} |
| 141 | + type=registry,ref=niis/xroad-security-server-sidecar:7.0.4 |
| 142 | + type=registry,ref=eclipse-temurin:8-alpine |
| 143 | + cache-to: type=inline |
| 144 | + tags: ${{ github.repository }} |
| 145 | + push: true |
| 146 | + - name: Update repo description |
| 147 | + uses: peter-evans/dockerhub-description@v3 |
| 148 | + with: |
| 149 | + username: ${{ github.repository_owner }} |
| 150 | + password: ${{ secrets.TOKEN }} |
| 151 | + short-description: ${{ github.event.repository.description }} |
| 152 | + - name: Show package info |
| 153 | + run: docker run --platform linux/amd64 --rm --entrypoint pip ${{ github.repository }} show ${{ github.event.repository.name }} --verbose |
0 commit comments