ProHoster > ΠΠ»ΠΎΠ³ > Kev tswj hwm > Yuav ua li cas thiaj ua tau qhov chaw zoo li qub ntawm Cloudflare Workers Sites
Yuav ua li cas thiaj ua tau qhov chaw zoo li qub ntawm Cloudflare Workers Sites
Nyob zoo! Kuv lub npe yog Dima, Kuv yog tus kws tshaj lij rau pab pawg SysOps ntawm Wrike. Hauv tsab xov xwm no kuv yuav qhia koj yuav ua li cas thiaj li ua kom lub vev xaib ze li sai tau rau tus neeg siv thiab ua kom nws siv tau rau hauv 10 feeb thiab 5 las ib hlis. Cov kab lus yuav luag tsis muaj dab tsi cuam tshuam nrog cov teeb meem uas peb daws hauv peb pab neeg. Qhov no yog qhov kuv tus kheej kev paub thiab kev xav paub txog kev paub txog kev siv tshuab tshiab rau kuv. Kuv sim piav qhia cov kauj ruam kom ntxaws kom ntau li ntau tau kom cov lus qhia yuav muaj txiaj ntsig zoo rau cov neeg uas muaj kev sib txawv. Kuv vam tias koj yuav txaus siab rau. Mus!
Yog li, tej zaum koj twb pom ib txoj hauv kev yooj yim thiab pheej yig los tuav lub vev xaib. Tej zaum txawm tias dawb, raws li tau piav qhia hauv qhov notsab xov xwm zoo.
Tab sis mam li nco dheev koj tseem dhuav thiab xav kov lub siab tawv lub ntiaj teb tshiab ntawm technology? Wb hais tias koj tab tom xav txog kev xa mus rau automating thiab xav kom koj lub xaib kom sai li sai tau? Hauv kab lus no peb yuav sivHugo, tab sis qhov no yog xaiv tau.
Peb siv Gitlab CI / CD rau automation, tab sis li cas txog acceleration? Cia peb xa lub xaib ncaj qha rau Cloudflare sivCov chaw ua haujlwm.
Yog tias koj twb tau teeb tsa Hugo, lossis yog tias koj xav tau lub tshuab hluav taws xob zoo li qub (lossis tsis siv ib qho), ces koj tuaj yeem hla qhov no.
Tam sim no peb qhov chaw zoo li qub nyob hauv ib phau ntawv ./public thiab npaj rau koj thawj phau ntawv xa mus.
Ntu 2: Kev teeb tsa Cloudflare
Tam sim no cia saib qhov pib teeb tsa ntawm Cloudflare. Cia peb xav tias peb twb muaj tus sau rau lub xaib. Cia peb ua piv txwv blog.example.com.
Kauj ruam 1: Tsim DNS nkag
Ua ntej, xaiv peb lub npe, thiab tom qab ntawd cov ntawv qhia zaub mov DNS. Peb tsim blog A-cov ntaub ntawv thiab qhia qee qhov tsis tseeb IP rau nws (qhov no yog tus nomkev pom zoo, tab sis lawv tuaj yeem ua kom nws zoo nkauj me ntsis).
Tsim ib cov ntaub ntawv .gitlab-ci.yml hauv paus nrog cov ntsiab lus hauv qab no:
stages:
- build
- deploy
build:
image: monachus/hugo
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- cd blog.example.com/
- hugo
artifacts:
paths:
- blog.example.com/public
only:
- master # this job will affect only the 'master' branch
tags:
- gitlab-org-docker #
deploy:
image: timbru31/ruby-node:2.3
stage: deploy
script:
- wget https://github.com/cloudflare/wrangler/releases/download/v1.8.4/wrangler-v1.8.4-x86_64-unknown-linux-musl.tar.gz
- tar xvzf wrangler-v1.8.4-x86_64-unknown-linux-musl.tar.gz
- cd blog.example.com/
- ../dist/wrangler publish
artifacts:
paths:
- blog.example.com/public
only:
- master # this job will affect only the 'master' branch
tags:
- gitlab-org-docker #
Peb tso thawj qhov kev xa tawm manually (CI/CD β Cov raj xa dej β Khiav Pipeline) los yog los ntawm kev cog lus rau tus tswv ceg. Voila!
xaus
Zoo, tej zaum kuv yuav tau understated nws me ntsis, thiab tag nrho cov txheej txheem siv li kaum feeb xwb. Tab sis tam sim no koj muaj qhov chaw nrawm nrog kev xa tawm tsis siv neeg thiab qee cov tswv yim tshiab txog dab tsi ntxiv koj tuaj yeem ua nrog Cov Neeg Ua Haujlwm.