diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2a345d61..23f241faa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -225,7 +225,10 @@ jobs: docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG buildBE: - if: ${{ github.event.inputs.version == '' }} + if: ${{ github.event.inputs.version == '' && (needs.CheckInputModules.outputs.ms-ente == 'true' || + needs.CheckInputModules.outputs.ms-gestione-utente == 'true' || needs.CheckInputModules.outputs.ms-notifiche-integration == 'true' || + needs.CheckInputModules.outputs.ms-open-data == 'true' || needs.CheckInputModules.outputs.ms-programma-progetto == 'true' || + needs.CheckInputModules.outputs.ms-questionario-cittadino == 'true' ) }} needs: [CheckInputModules, DryRunRelease] name: BE Build runs-on: ubuntu-latest @@ -401,11 +404,10 @@ jobs: Deploy: needs: [CheckInputModules, DryRunRelease, buildFE, buildBE] - if: | - always() && + if: ${{ always() && needs.DryRunRelease.result == 'success' && (needs.buildFE.result == 'success' || needs.buildFE.result == 'skipped') && - (needs.buildBE.result == 'success' || needs.buildBE.result == 'skipped') + (needs.buildBE.result == 'success' || needs.buildBE.result == 'skipped') }} name: Deploy runs-on: ubuntu-latest environment: ${{ github.event.inputs.environment }} @@ -575,8 +577,11 @@ jobs: kubectl apply -f deployment.yml RepoUpdate: - if: ${{ github.event.inputs.version == '' }} needs: [CheckInputModules, DryRunRelease, Deploy] + if: ${{ github.event.inputs.version == '' && always() && + needs.CheckInputModules.result == 'success' && needs.DryRunRelease.result == 'success' && needs.Deploy.result == 'success' && + (needs.buildFE.result == 'success' || needs.buildFE.result == 'skipped') && + (needs.buildBE.result == 'success' || needs.buildBE.result == 'skipped') }} name: Repo Update runs-on: ubuntu-latest environment: ${{ github.event.inputs.environment }} @@ -653,8 +658,8 @@ jobs: git push Release: - if: ${{ github.event.inputs.version == '' }} needs: [RepoUpdate] + if: ${{ github.event.inputs.version == '' && always() && needs.RepoUpdate.result == 'success' }} name: Release runs-on: ubuntu-latest environment: ${{ github.event.inputs.environment }} diff --git a/fe-piattaforma/Dockerfile b/fe-piattaforma/Dockerfile index 8111980a8..31f38afbd 100644 --- a/fe-piattaforma/Dockerfile +++ b/fe-piattaforma/Dockerfile @@ -4,6 +4,8 @@ RUN apk --update add nginx RUN rm -rf /usr/share/nginx/html/* +COPY fe-piattaforma.nginx.conf /etc/nginx/conf.d/default.conf + COPY build /usr/share/nginx/html EXPOSE 80 diff --git a/fe-piattaforma/fe-piattaforma.nginx.conf b/fe-piattaforma/fe-piattaforma.nginx.conf new file mode 100644 index 000000000..0219311a0 --- /dev/null +++ b/fe-piattaforma/fe-piattaforma.nginx.conf @@ -0,0 +1,28 @@ +server { + listen 80; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html$is_args$args =404; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +}