diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index e03c8cb..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: Run Taxtastic unittests - -on: - push: - branches: - - "*" - tags: - - "v*.*.*" - pull_request: - branches: - - "master" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - deploy: - needs: [unittests] - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log into registry ${{ env.REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push - id: build-and-push - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ github.ref_type == 'tag' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Sign the published Docker image - if: ${{ github.ref_type == 'tag' }} - env: - TAGS: ${{ steps.meta.outputs.tags }} - DIGEST: ${{ steps.build-and-push.outputs.digest }} - run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index e1c984e..f830751 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -18,7 +18,6 @@ env: jobs: unittests: runs-on: ubuntu-latest - strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] @@ -41,14 +40,16 @@ jobs: run: python -m unittest discover deploy: + if: github.ref_type == 'tag' needs: [unittests] - runs-on: ubuntu-latest permissions: contents: read packages: write id-token: write + runs-on: ubuntu-latest + steps: - - name: Checkout + - name: Checkout repo uses: actions/checkout@v4 - name: Set up Docker Buildx @@ -71,15 +72,14 @@ jobs: id: build-and-push uses: docker/build-push-action@v6 with: - context: . - push: ${{ github.ref_type == 'tag' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + context: . + labels: ${{ steps.meta.outputs.labels }} + push: true + tags: ${{ steps.meta.outputs.tags }} - name: Sign the published Docker image - if: ${{ github.ref_type == 'tag' }} env: TAGS: ${{ steps.meta.outputs.tags }} DIGEST: ${{ steps.build-and-push.outputs.digest }}