Skip to content

Commit

Permalink
chore: workflow improvements Feat/devops (#142)
Browse files Browse the repository at this point in the history
* chore: add nginx conf file

* chore: add nginx conf file

* fix: check if build BE job

* chore: check if repoupdate job

* fix: check if release job

* fix: location try_files

* fix: location try_files

* fix: copy nginx conf

Co-authored-by: MattMod <86956468+MattMod@users.noreply.github.com>
  • Loading branch information
marcolovazzano and MattMod committed Jul 5, 2022
1 parent 27cc0c5 commit 6f195ff
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions fe-piattaforma/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions fe-piattaforma/fe-piattaforma.nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
#}
}

0 comments on commit 6f195ff

Please sign in to comment.