From 9030fc8641f0279016ab960abf1cc37e326bff33 Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 20:54:42 +0200 Subject: [PATCH 1/9] made website responsive Made the website responsive rewritten about added sponsor section modified github action to deploy to dev / prod depending on branch --- .github/workflows/google.yml | 36 ++++++++- assets/colors.scss | 3 + assets/global.scss | 28 ++++--- components/about.vue | 15 ---- components/home.vue | 66 ---------------- components/homepage/about.vue | 20 +++++ components/{ => homepage}/design.vue | 33 ++++++-- components/{ => homepage}/features.vue | 48 ++++++------ components/homepage/home.vue | 51 +++++++++++++ components/homepage/mission.vue | 20 +++++ components/{ => homepage}/safety.vue | 28 +++++-- components/homepage/sponsor.vue | 21 ++++++ components/homepage/useCases.vue | 40 ++++++++++ components/imgElememt.vue | 100 +++++++++++++++++++++++++ components/mission.vue | 34 --------- components/useCases.vue | 82 -------------------- layouts/default.vue | 42 ++++++++++- layouts/error.vue | 22 ++++++ pages/imprint.vue | 84 +++++++++++++++++++++ pages/index.vue | 43 +++++++---- static/images/logo.svg | 4 + 21 files changed, 551 insertions(+), 269 deletions(-) delete mode 100644 components/about.vue delete mode 100644 components/home.vue create mode 100644 components/homepage/about.vue rename components/{ => homepage}/design.vue (73%) rename components/{ => homepage}/features.vue (60%) create mode 100644 components/homepage/home.vue create mode 100644 components/homepage/mission.vue rename components/{ => homepage}/safety.vue (53%) create mode 100644 components/homepage/sponsor.vue create mode 100644 components/homepage/useCases.vue create mode 100644 components/imgElememt.vue delete mode 100644 components/mission.vue delete mode 100644 components/useCases.vue create mode 100644 layouts/error.vue create mode 100644 pages/imprint.vue create mode 100644 static/images/logo.svg diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml index a8a9d7e..9cc8fb1 100644 --- a/.github/workflows/google.yml +++ b/.github/workflows/google.yml @@ -1,8 +1,19 @@ name: Deploy the application to Google Cloud Run +# on: +# push: +# branches: +# - 'master' + on: + pull_request: + branches: + - 'develop' + - 'master' + push: - branches: + branches: + - 'develop' - 'master' jobs: @@ -12,10 +23,20 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v1 + + - name: Set env default + run: | + echo "::set-env name=STAGE::dev" + + - name: Set env to production + if: endsWith(github.ref, '/master') + run: | + echo "::set-env name=STAGE::prod" - name: Build Docker image run: | docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + - name: Authenticate into Google Cloud Platform uses: GoogleCloudPlatform/github-actions/setup-gcloud@master with: @@ -26,8 +47,15 @@ jobs: run: "gcloud auth configure-docker --quiet" - name: Push image to Google Cloud Container Registry - run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + if: $STAGE == prod + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + else: + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} - name: Install commands and deploy on cloud run - run: | - gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed + if: $STAGE == prod + run: | + gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed + else: + run: | + gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed diff --git a/assets/colors.scss b/assets/colors.scss index e69de29..10ff7c3 100644 --- a/assets/colors.scss +++ b/assets/colors.scss @@ -0,0 +1,3 @@ +$background: #2F2F2F; +$textColor: #F1F1F1; +$footer: #4A4A4A; diff --git a/assets/global.scss b/assets/global.scss index 8cc3b76..09eefea 100644 --- a/assets/global.scss +++ b/assets/global.scss @@ -1,25 +1,23 @@ +@import '@/assets/colors'; + * { box-sizing: border-box; - margin: 0; - padding: 0; } -html { - background: #2F2F2F; +html, body { + margin: 0; + padding: 0; font-family: 'Montserrat', sans-serif; + background: $background; } -h1, h2, h3, h4, h5, p { - color: #F1F1F1; +h1, h2, h3, p, a { + color: $textColor; text-align: center; } -h2 { - margin-bottom: 10px; -} - -a { - color:#F1F1F1; - text-decoration: none; - margin: 10px; -} +@media only screen and (max-width: 765px) { + body { + padding: 10px; + } +} \ No newline at end of file diff --git a/components/about.vue b/components/about.vue deleted file mode 100644 index 44c3050..0000000 --- a/components/about.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/components/home.vue b/components/home.vue deleted file mode 100644 index 8dcb338..0000000 --- a/components/home.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - diff --git a/components/homepage/about.vue b/components/homepage/about.vue new file mode 100644 index 0000000..0509c85 --- /dev/null +++ b/components/homepage/about.vue @@ -0,0 +1,20 @@ + + + diff --git a/components/design.vue b/components/homepage/design.vue similarity index 73% rename from components/design.vue rename to components/homepage/design.vue index a2504d0..29ac8e2 100644 --- a/components/design.vue +++ b/components/homepage/design.vue @@ -1,21 +1,38 @@ - + diff --git a/components/features.vue b/components/homepage/features.vue similarity index 60% rename from components/features.vue rename to components/homepage/features.vue index a2f4da2..4111a14 100644 --- a/components/features.vue +++ b/components/homepage/features.vue @@ -1,56 +1,58 @@ - - - + + diff --git a/components/homepage/mission.vue b/components/homepage/mission.vue new file mode 100644 index 0000000..d421160 --- /dev/null +++ b/components/homepage/mission.vue @@ -0,0 +1,20 @@ + + + diff --git a/components/safety.vue b/components/homepage/safety.vue similarity index 53% rename from components/safety.vue rename to components/homepage/safety.vue index ccec5eb..2b503c6 100644 --- a/components/safety.vue +++ b/components/homepage/safety.vue @@ -1,15 +1,31 @@ - + diff --git a/components/homepage/sponsor.vue b/components/homepage/sponsor.vue new file mode 100644 index 0000000..ac039d9 --- /dev/null +++ b/components/homepage/sponsor.vue @@ -0,0 +1,21 @@ + + + diff --git a/components/homepage/useCases.vue b/components/homepage/useCases.vue new file mode 100644 index 0000000..a945a8f --- /dev/null +++ b/components/homepage/useCases.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/components/imgElememt.vue b/components/imgElememt.vue new file mode 100644 index 0000000..3f5125d --- /dev/null +++ b/components/imgElememt.vue @@ -0,0 +1,100 @@ + + + + + diff --git a/components/mission.vue b/components/mission.vue deleted file mode 100644 index 72c7a63..0000000 --- a/components/mission.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - diff --git a/components/useCases.vue b/components/useCases.vue deleted file mode 100644 index 3352057..0000000 --- a/components/useCases.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - diff --git a/layouts/default.vue b/layouts/default.vue index 3f73f58..58f7460 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,9 +1,47 @@ - diff --git a/layouts/error.vue b/layouts/error.vue new file mode 100644 index 0000000..0ea07e6 --- /dev/null +++ b/layouts/error.vue @@ -0,0 +1,22 @@ + + + \ No newline at end of file diff --git a/pages/imprint.vue b/pages/imprint.vue new file mode 100644 index 0000000..2133410 --- /dev/null +++ b/pages/imprint.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/pages/index.vue b/pages/index.vue index bd0457c..ceda5ac 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -7,9 +7,12 @@ + +
- + Imprint +

© Autofly 2020

@@ -18,12 +21,14 @@ import { Vue, Component } from 'nuxt-property-decorator' import { Meta } from '@/decorators/meta' -import home from '@/components/home.vue' -import mission from '@/components/mission.vue' -import features from '@/components/features.vue' -import useCases from '@/components/useCases.vue' -import design from '@/components/design.vue' -import safety from '@/components/safety.vue' +import home from '@/components/homepage/home.vue' +import mission from '@/components/homepage/mission.vue' +import features from '@/components/homepage/features.vue' +import useCases from '@/components/homepage/useCases.vue' +import design from '@/components/homepage/design.vue' +import safety from '@/components/homepage/safety.vue' +import about from '@/components/homepage/about.vue' +import sponsor from '@/components/homepage/sponsor.vue' @Component({ components: { @@ -32,7 +37,9 @@ import safety from '@/components/safety.vue' features, useCases, design, - safety + safety, + about, + sponsor } }) export default class Home extends Vue { @@ -53,16 +60,24 @@ export default class Home extends Vue { diff --git a/static/images/logo.svg b/static/images/logo.svg new file mode 100644 index 0000000..a0a9f7e --- /dev/null +++ b/static/images/logo.svg @@ -0,0 +1,4 @@ + + + + From 7bf61522095f3edb24b6792de237be50c5c27b21 Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 20:59:22 +0200 Subject: [PATCH 2/9] fixed workflow file --- .github/workflows/google.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml index 9cc8fb1..510621f 100644 --- a/.github/workflows/google.yml +++ b/.github/workflows/google.yml @@ -1,18 +1,14 @@ name: Deploy the application to Google Cloud Run -# on: -# push: -# branches: -# - 'master' on: pull_request: - branches: + branches: - 'develop' - 'master' - + push: - branches: + branches: - 'develop' - 'master' @@ -23,7 +19,7 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v1 - + - name: Set env default run: | echo "::set-env name=STAGE::dev" @@ -49,13 +45,13 @@ jobs: - name: Push image to Google Cloud Container Registry if: $STAGE == prod run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - else: + if: $STAGE == dev run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} - name: Install commands and deploy on cloud run if: $STAGE == prod run: | gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed - else: - run: | + if: $STAGE == dev + run: | gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed From 3039f01e3db4237b8372773c6afa520785e1ca4c Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 21:19:15 +0200 Subject: [PATCH 3/9] fixed workflow file --- .github/workflows/google.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml index 510621f..9d167e5 100644 --- a/.github/workflows/google.yml +++ b/.github/workflows/google.yml @@ -43,15 +43,8 @@ jobs: run: "gcloud auth configure-docker --quiet" - name: Push image to Google Cloud Container Registry - if: $STAGE == prod - run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - if: $STAGE == dev - run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - name: Install commands and deploy on cloud run - if: $STAGE == prod - run: | - gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed - if: $STAGE == dev - run: | - gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed + run: | + gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed From aeaea3fc165daad4075b5754f9e23659606eed57 Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 21:28:00 +0200 Subject: [PATCH 4/9] added dev / prod workflow --- .github/workflows/google.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml index 9d167e5..bd37456 100644 --- a/.github/workflows/google.yml +++ b/.github/workflows/google.yml @@ -22,16 +22,16 @@ jobs: - name: Set env default run: | - echo "::set-env name=STAGE::dev" + echo "::set-env name=STAGE::GCLOUD_APP_NAME_DEV" - name: Set env to production if: endsWith(github.ref, '/master') run: | - echo "::set-env name=STAGE::prod" + echo "::set-env name=STAGE::GCLOUD_APP_NAME" - name: Build Docker image run: | - docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.$STAGE }} - name: Authenticate into Google Cloud Platform uses: GoogleCloudPlatform/github-actions/setup-gcloud@master @@ -43,8 +43,8 @@ jobs: run: "gcloud auth configure-docker --quiet" - name: Push image to Google Cloud Container Registry - run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.$STAGE }} - name: Install commands and deploy on cloud run run: | - gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed + gcloud run deploy ${{ secrets.$STAGE }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.$STAGE }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed From 42859e054ab76db62255de39c4f4314a65e5d5fb Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 21:42:28 +0200 Subject: [PATCH 5/9] added dev / prod workflow --- .github/workflows/google.yml | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml index bd37456..7c05f1f 100644 --- a/.github/workflows/google.yml +++ b/.github/workflows/google.yml @@ -22,16 +22,22 @@ jobs: - name: Set env default run: | - echo "::set-env name=STAGE::GCLOUD_APP_NAME_DEV" + echo "::set-env name=STAGE::dev" - name: Set env to production if: endsWith(github.ref, '/master') run: | - echo "::set-env name=STAGE::GCLOUD_APP_NAME" + echo "::set-env name=STAGE:prod" - - name: Build Docker image + - name: Build Docker image for production + if: $STAGE == prod run: | - docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.$STAGE }} + docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + + - name: Build Docker image for dev + if: $STAGE == dev + run: | + docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} - name: Authenticate into Google Cloud Platform uses: GoogleCloudPlatform/github-actions/setup-gcloud@master @@ -42,9 +48,20 @@ jobs: - name: Configure Docker to use Google Cloud Platform run: "gcloud auth configure-docker --quiet" - - name: Push image to Google Cloud Container Registry - run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.$STAGE }} + - name: Push image to Google Cloud Container Registry for production + if: $STAGE == prod + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + + - name: Push image to Google Cloud Container Registry for dev + if: $STAGE == dev + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} + + - name: Install commands and deploy on cloud run for production + if: $STAGE == prod + run: | + gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed - - name: Install commands and deploy on cloud run + - name: Install commands and deploy on cloud run for dev + if: $STAGE == prod run: | - gcloud run deploy ${{ secrets.$STAGE }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.$STAGE }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed + gcloud run deploy ${{ secrets.GCLOUD_APP_NAME_DEV }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed From 1638aa41d54f42973b1b26248361dd7797aff937 Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 21:52:22 +0200 Subject: [PATCH 6/9] fixed workflow file --- .github/workflows/google.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml index 7c05f1f..5af848a 100644 --- a/.github/workflows/google.yml +++ b/.github/workflows/google.yml @@ -21,21 +21,21 @@ jobs: uses: actions/checkout@v1 - name: Set env default - run: | - echo "::set-env name=STAGE::dev" + env: + SERVER: dev - name: Set env to production if: endsWith(github.ref, '/master') - run: | - echo "::set-env name=STAGE:prod" + env: + SERVER: prod - name: Build Docker image for production - if: $STAGE == prod + if: SERVER == prod run: | docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - name: Build Docker image for dev - if: $STAGE == dev + if: SERVER == dev run: | docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} @@ -49,19 +49,19 @@ jobs: run: "gcloud auth configure-docker --quiet" - name: Push image to Google Cloud Container Registry for production - if: $STAGE == prod + if: SERVER == prod run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - name: Push image to Google Cloud Container Registry for dev - if: $STAGE == dev + if: SERVER == dev run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} - name: Install commands and deploy on cloud run for production - if: $STAGE == prod + if: SERVER == prod run: | gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed - name: Install commands and deploy on cloud run for dev - if: $STAGE == prod + if: SERVER == prod run: | gcloud run deploy ${{ secrets.GCLOUD_APP_NAME_DEV }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed From 54666bbad6b0062b9fea9ed9a9abe6970e7b0c75 Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 21:59:34 +0200 Subject: [PATCH 7/9] fixed workflow file --- .github/workflows/google.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml index 5af848a..a44d362 100644 --- a/.github/workflows/google.yml +++ b/.github/workflows/google.yml @@ -30,12 +30,12 @@ jobs: SERVER: prod - name: Build Docker image for production - if: SERVER == prod + if: env.SERVER == prod run: | docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - name: Build Docker image for dev - if: SERVER == dev + if: env.SERVER == dev run: | docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} @@ -49,19 +49,19 @@ jobs: run: "gcloud auth configure-docker --quiet" - name: Push image to Google Cloud Container Registry for production - if: SERVER == prod + if: env.SERVER == prod run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - name: Push image to Google Cloud Container Registry for dev - if: SERVER == dev + if: env.SERVER == dev run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} - name: Install commands and deploy on cloud run for production - if: SERVER == prod + if: env.SERVER == prod run: | gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed - name: Install commands and deploy on cloud run for dev - if: SERVER == prod + if: env.SERVER == prod run: | gcloud run deploy ${{ secrets.GCLOUD_APP_NAME_DEV }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed From 7aae8ba38af6760962faaeb98d1423bea8fdc5e4 Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 22:17:19 +0200 Subject: [PATCH 8/9] fixed workflow file --- .github/workflows/dev.yml | 39 +++++++++++++++++++++ .github/workflows/google.yml | 67 ------------------------------------ .github/workflows/prod.yml | 34 ++++++++++++++++++ 3 files changed, 73 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/dev.yml delete mode 100644 .github/workflows/google.yml create mode 100644 .github/workflows/prod.yml diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..e3ff123 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,39 @@ + +name: Deploy the application to Google Cloud Run + +on: + pull_request: + branches: + - 'develop' + + push: + branches: + - 'develop' + +jobs: + deploy: + name: Deploy job for dev + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v1 + + - name: Build Docker image + run: | + docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} + + - name: Authenticate into Google Cloud Platform + uses: GoogleCloudPlatform/github-actions/setup-gcloud@master + with: + service_account_email: ${{ secrets.GCLOUD_EMAIL }} + service_account_key: ${{ secrets.GCLOUD_AUTH }} + + - name: Configure Docker to use Google Cloud Platform + run: "gcloud auth configure-docker --quiet" + + - name: Push image to Google Cloud Container Registry + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} + + - name: Install commands and deploy on cloud run + run: | + gcloud run deploy ${{ secrets.GCLOUD_APP_NAME_DEV }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml deleted file mode 100644 index a44d362..0000000 --- a/.github/workflows/google.yml +++ /dev/null @@ -1,67 +0,0 @@ - -name: Deploy the application to Google Cloud Run - -on: - pull_request: - branches: - - 'develop' - - 'master' - - push: - branches: - - 'develop' - - 'master' - -jobs: - deploy: - name: Deploy job - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v1 - - - name: Set env default - env: - SERVER: dev - - - name: Set env to production - if: endsWith(github.ref, '/master') - env: - SERVER: prod - - - name: Build Docker image for production - if: env.SERVER == prod - run: | - docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - - - name: Build Docker image for dev - if: env.SERVER == dev - run: | - docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} - - - name: Authenticate into Google Cloud Platform - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master - with: - service_account_email: ${{ secrets.GCLOUD_EMAIL }} - service_account_key: ${{ secrets.GCLOUD_AUTH }} - - - name: Configure Docker to use Google Cloud Platform - run: "gcloud auth configure-docker --quiet" - - - name: Push image to Google Cloud Container Registry for production - if: env.SERVER == prod - run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} - - - name: Push image to Google Cloud Container Registry for dev - if: env.SERVER == dev - run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} - - - name: Install commands and deploy on cloud run for production - if: env.SERVER == prod - run: | - gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed - - - name: Install commands and deploy on cloud run for dev - if: env.SERVER == prod - run: | - gcloud run deploy ${{ secrets.GCLOUD_APP_NAME_DEV }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME_DEV }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml new file mode 100644 index 0000000..68be0eb --- /dev/null +++ b/.github/workflows/prod.yml @@ -0,0 +1,34 @@ +name: Deploy the application to Google Cloud Run + +on: + pull_request: + branches: + - 'master' + +jobs: + deploy: + name: Deploy job for prod + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v1 + + - name: Build Docker image for production + run: | + docker build . --tag gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + + - name: Authenticate into Google Cloud Platform + uses: GoogleCloudPlatform/github-actions/setup-gcloud@master + with: + service_account_email: ${{ secrets.GCLOUD_EMAIL }} + service_account_key: ${{ secrets.GCLOUD_AUTH }} + + - name: Configure Docker to use Google Cloud Platform + run: "gcloud auth configure-docker --quiet" + + - name: Push image to Google Cloud Container Registry + run: docker push gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} + + - name: Install commands and deploy on cloud run + run: | + gcloud run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed From aff4beaf79ac90a5141fc07f388d54e0d88c40bc Mon Sep 17 00:00:00 2001 From: johann-su <“[johann123.js@gmail.com]”> Date: Mon, 13 Apr 2020 22:24:42 +0200 Subject: [PATCH 9/9] fixed workflow file --- .github/workflows/dev.yml | 2 +- .github/workflows/prod.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index e3ff123..14bb2c8 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -1,4 +1,4 @@ - +# Deploing to dev server name: Deploy the application to Google Cloud Run on: diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 68be0eb..0a9e8fe 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -1,3 +1,4 @@ +# Deploing to prod server name: Deploy the application to Google Cloud Run on: