diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 400903688..271b5a1c5 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -6,67 +6,13 @@ on: - "v*" jobs: - - build-and-push-image: - + build-and-push-container: runs-on: ubuntu-latest - permissions: contents: read packages: write - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Get tags - shell: python - run: | - import re - from packaging.version import parse - - version = "${{ github.ref }}".replace("refs/tags/v", "") - image = "ghcr.io/${{ github.repository }}" - - tags = set() - - # full version - tags.add(f"{image}:{version}") - - if not parse(version).is_prerelease: - # only final and post-releases should get the tags - # used for automatic use of latest *stable* version - - # major_version - major_version = re.search(r'(\d+?)\.', version).group(1) - tags.add(f"{image}:{major_version}") - - # major_version.minor_version - major_and_minor_version = re.search(r'(\d+?\.\d+?)\.', version).group(1) - tags.add(f"{image}:{major_and_minor_version}") - - tags.add(f"{image}:latest") - - tags = ",".join(sorted(list(tags))) - - print(f"::set-output name=tags::{tags}") - - id: tags - - - name: Build and push - uses: docker/build-push-action@v4 + - uses: voxpupuli/gha-build-and-publish-a-container@v1 with: - context: . - platforms: linux/amd64 - push: true - tags: ${{ steps.tags.outputs.tags }} + github_token: ${{ secrets.GITHUB_TOKEN }} + build_arch: linux/amd64,linux/arm64 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bff29ca6c..d3d44ed88 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: python-version: [3.8, 3.9, '3.10', 3.11] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -42,10 +42,24 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true + build_docker_image: + name: 'Test building a container' + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: false + security-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.11 uses: actions/setup-python@v4 with: