inlivedev / inlive-website

inlive static site for blog and documentation
0 stars 0 forks source link

Deploy inlive-website repo to inlive.app #15

Closed faiq-naufal closed 2 years ago

faiq-naufal commented 2 years ago

What is the issue about?

Setup and deployment execution for inlive-website repo on inlive.app domain.

How urgent this issue?

High priority and high urgency

Describe the issue

This issue is the continuation for inlive repo domain switching issue. Our inlive-website repo is a repo mainly focuses on static content such as landing page, documentation, and blog. Currently, the repo hasn't been deployed to live server. We need to deploy inlive-website repo and point it to inlive.app domain.

This issue is created separately because we need to do deployment setup and preparation before pointing the inlive-website repo to inlive.app domain which are different tasks with the domain switching issue.

What is the possible solution we have?

We will deploy the inlive-website repo on Cloud Run platform because our other front end applications were deployed there. To accomplish this, these are the things that we need to do:

After these tasks are accomplished we are ready to deploy our application on Cloud Run. We need to set the DNS our inlive-website to point to inlive.app

cc: @rhgenius

faiq-naufal commented 2 years ago

Mas @rhgenius. For deployment, the Hugo command that we will use is hugo --gc --minify. This will generate a public directory that contains all static files will be deployed. Please refer to the setup step number 5 here

rhgenius commented 2 years ago

@faiq-naufal we will use cloud run which is only run if there is any incoming traffic, that's why we need to generate hugo website and use nginx to serving the website, the goal is those generated public file by hugo exposed by nginx, if we use always up server then we cannot use cloud run, CMIIAW

rhgenius commented 2 years ago

@faiq-naufal we will use cloud run which is only run if there is any incoming traffic, that's why we need to generate hugo website and use nginx to serving the website, the goal is those generated public file by hugo exposed by nginx, if we use always up server then we cannot use cloud run, CMIIAW

@faiq-naufal we will use Cloud Flare Pages for the dev environment and it seems already deploy perfectly, for the prod environment we will use Github Pages, so I create new repository for our sandbox https://github.com/asumsi/inlive-web-prod and we need your help to make some adjustment based on this error: Error: Error building site: POSTCSS: failed to transform "css/tailwind.css" (text/css): Error: Loading PostCSS Plugin failed: Cannot find module 'tailwindcss' we found solution for this error based on https://github.com/withastro/snowpack/discussions/988 we need to do some changes to tailwindcss such as https://tailwindcss.com/docs/installation#post-css-7-compatibility-build

FYI, why we put our different environment on different provider is because of this 2 reason:

  1. Github Action only triggered on main branch only and we need to find another solution for the dev branch
  2. Cloud Flare Pages only deploy one branch for each repository, so we cannot put it all both environment on the Cloud Flare Pages

Kindly please make some adjustment on the repository https://github.com/asumsi/inlive-web-prod for our sandbox, just create the branch rebase from main branch and merge it to main branch and we can see the result on https://github.com/asumsi/inlive-web-prod/actions

Many thanks for your help @faiq-naufal

rhgenius commented 2 years ago

Hi mas @faiq-naufal you can now access the dev.inlive.app subdomain and it will be automatically build every time there is push to branch dev on inlive-website repository

faiq-naufal commented 2 years ago

Mas @rhgenius, ada kejanggalan sama deploymentnya yg mungkin bisa tolong dicek lagi.

  1. Untuk production dengan domain inlive.app kan dari branch main, seharusnya update developer portal di branch main itu belum ada karena baru ada di branch dev dan belum dimerge ke main. Tapi ketika aku kunjungi https://inlive.app/docs/introduction/ UI untuk developer portalnya udah ada. Apa benar ini deployment dari branch main?

  2. Untuk domain dev.inlive.app deployment dari branch dev. Seharusnya developer portal dan blog update UI nya sudah bisa dilihat. Tapi yang baru bisa dilihat adalah developer portal saja https://dev.inlive.app/docs/introduction/ , sementara kalau mengunjungi halaman blog https://dev.inlive.app/blog/ tampilannya cuma ada text saja. Boleh dicek lagi deploymentnya mas?

rhgenius commented 2 years ago

screencapture-console-cloud-google-cloud-build-triggers-edit-8becc527-d9ad-46e9-851a-20985c92f13c-2022-03-22-15_16_06 mas @faiq-naufal saya sudah cek di Cloud Build untuk yang dev seperti diatas, ada yang perlu dibantu ketika saya buat ulang di cloud flare pages ada error yang saya lampirkan berikut ini: inlive-website.13f7bbf3-2e63-44ff-8f37-4adb59f97381.log apakah branch main sudah sama dengan dev mas @faiq-naufal ?

faiq-naufal commented 2 years ago

mas @rhgenius

mas @faiq-naufal saya sudah cek di Cloud Build untuk yang dev seperti diatas

Branch dev bagian blognya masih belum muncul updatenya. Apa perlu diredeploy ya mas dari cloud build nya?

ketika saya buat ulang di cloud flare pages ada error yang saya lampirkan berikut ini: inlive-website.13f7bbf3-2e63-44ff-8f37-4adb59f97381.log

Hmm, untuk error ini seharusnya udah disolve di branch dev tapi di branch main belum karena belum dimerge. Ini berkaitan dengan Hugo versi baru kalau di kita versi 0.93.2 akan komplain karena menggunakan .URL untuk link (deprecated) di sini yang akan membuat build nya jadi error.

Kalau diturunkan aja versi Hugonya saat ini gimana mas? ke versi 0.92.2

apakah branch main sudah sama dengan dev?

Belum mas, untuk update dokumentasi portal dan blog seharusnya baru di dev belum dimerge ke main

faiq-naufal commented 2 years ago

mas @rhgenius Boleh minta tolong dilist mas file yang akhirnya digunakan untuk deployment untuk branch dev. Karena pas lihat di sini https://github.com/asumsi/inlive-website/tree/dev ada beberapa file yang aku kurang tahu nih apa filenya masih dipakai atau enggak. Contohnya: site.conf, docker.sh

Updated on here

rhgenius commented 2 years ago

mas @rhgenius Boleh minta tolong dilist mas file yang akhirnya digunakan untuk deployment untuk branch dev. Karena pas lihat di sini https://github.com/asumsi/inlive-website/tree/dev ada beberapa file yang aku kurang tahu nih apa filenya masih dipakai atau enggak. Contohnya: site.conf, docker.sh

Updated on here

sudah mas, dokumentasi juga sudah saya update

faiq-naufal commented 2 years ago

Untuk task ini branch main sudah berhasil diarahkan ke inlive.app dideploy ke Cloudflare Pages dan branch dev sudah berhasil diarahkan ke dev.inlive.app dan dideploy ke Kubernetes cluster.

Mas @tyohan, untuk branch dev yang sekarang bisa kita merge ke main?

tyohan commented 2 years ago

Kayaknya no issue karena kita belum launching juga. Silakan aja dimerge @faiq-naufal

faiq-naufal commented 2 years ago

Mas @rhgenius, ketika ada merge ke branch dev buildnya udah berhasil tapi updatenya masih belum muncul di dev.inlive.app. Boleh minta tolong dicek lagi.

faiq-naufal commented 2 years ago

This issue is closed because we have successfully deployed this inlive-website repo. Currently, we have fully switched the deployment for all branches to Cloudflare pages. The domain dev.inlive.app is disabled for now. Dev: https://dev.inlive-website.pages.dev Production: https://inlive.app