-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,13 +57,13 @@ jobs: | |
# Dockerfile tests | ||
# | ||
test_dockerfiles: | ||
if: github.event.schedule == '' | ||
runs-on: ubuntu-latest | ||
name: Linters for Dockerfile | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
- name: hadolint | ||
if: github.event.schedule == '' | ||
uses: hadolint/[email protected] | ||
with: | ||
recursive: true | ||
|
@@ -72,6 +72,7 @@ jobs: | |
# SonarCloud job | ||
# | ||
test_sonar: | ||
if: github.event_name != 'pull_request' | ||
needs: [ | ||
test_python, | ||
test_markdownlint, | ||
|
@@ -85,7 +86,6 @@ jobs: | |
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: SonarCloud Scan | ||
if: github.event_name != 'pull_request' | ||
uses: sonarsource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
|
@@ -175,7 +175,7 @@ jobs: | |
# Build and deploy job (only on main) | ||
# | ||
docker_build_deploy: | ||
if: github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v') | ||
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || ${{ startsWith(github.ref, 'refs/tags/v') }}) | ||
needs: [ | ||
test_docker | ||
] | ||
|
@@ -187,13 +187,11 @@ jobs: | |
# Login against 2 Docker registries except on PR | ||
# https://github.com/docker/login-action | ||
- name: Log in to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Log into registry ${{ env.GHCR_REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.GHCR_REGISTRY }} | ||
|
@@ -222,10 +220,10 @@ jobs: | |
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:main | ||
cache-to: type=inline | ||
- name: Set env | ||
if: contains(github.ref, 'refs/tags/v') | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}) | ||
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV | ||
- name: Build and push Docker image | ||
if: contains(github.ref, 'refs/tags/v') | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}) | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
|
@@ -242,11 +240,11 @@ jobs: | |
# Release job | ||
# | ||
release: | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}) | ||
needs: [ | ||
package, | ||
] | ||
runs-on: ubuntu-latest | ||
if: contains(github.ref, 'refs/tags/v') | ||
name: Release on GitHub and PyPi | ||
steps: | ||
- name: Git checkout | ||
|