PageSourceSearch

https://gha-trigger.github.io/assets/js/d589d3a7.dade569d.js

js gha-trigger.github.io collected 2026-10-03 09:14:30 UTC 11,171 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkgha_trigger=self.webpackChunkgha_trigger||[]).push([[162],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>k});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var p=a.createContext({}),u=function(e){var t=a.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},s=function(e){var t=u(e.components);return a.createElement(p.Provider,{value:t},e.children)},m="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},g=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,p=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),m=u(r),g=n,k=m["".concat(p,".").concat(g)]||m[g]||c[g]||i;return r?a.createElement(k,l(l({ref:t},s),{},{components:r})):a.createElement(k,l({ref:t},s))}));function k(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,l=new Array(i);l[0]=g;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[m]="string"==typeof e?e:n,l[1]=o;for(var u=2;u<i;u++)l[u]=r[u];return a.createElement.apply(null,l)}return a.createElement.apply(null,r)}g.displayName="MDXCreateElement"},9390:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>c,frontMatter:()=>i,metadata:()=>o,toc:()=>u});var a=r(7462),n=(r(7294),r(3905));const i={sidebar_position:100},l="Getting Started",o={unversionedId:"getting-started",id:"getting-started",title:"Getting Started",description:"In the Getting Started, you will set up gha-trigger and experience CI with gha-trigger.",source:"@site/docs/getting-started.md",sourceDirName:".",slug:"/getting-started",permalink:"/getting-started",draft:!1,editUrl:"https://github.com/gha-trigger/gha-trigger.github.io/edit/main/docs/getting-started.md",tags:[],version:"current",sidebarPosition:100,frontMatter:{sidebar_position:100},sidebar:"tutorialSidebar",previous:{title:"gha-trigger",permalink:"/"},next:{title:"Configuration",permalink:"/config/"}},p={},u=[{value:"Requirement",id:"requirement",level:2},{value:"Steps",id:"steps",level:2},{value:"1. Create GitHub Repositories from template repositories",id:"1-create-github-repositories-from-template-repositories",level:3},{value:"Create the remote branch <code>pull_request</code> in <code>CI Repository</code>.",id:"create-the-remote-branch-pull_request-in-ci-repository",level:4},{value:"3. Set up Terraform Configuration",id:"3-set-up-terraform-configuration",level:3},{value:"4. Apply Terraform",id:"4-apply-terraform",level:3},{value:"5. Create GitHub Apps",id:"5-create-github-apps",level:3},{value:"6. Set GitHub App ID and Private Key",id:"6-set-github-app-id-and-private-key",level:3},{value:"7. Apply Terraform again",id:"7-apply-terraform-again",level:3},{value:"8. Run Manual Workflow",id:"8-run-manual-workflow",level:3},{value:"10. Clean up",id:"10-clean-up",level:2}],s={toc:u},m="wrapper";function c(e){let{components:t,...r}=e;return(0,n.kt)(m,(0,a.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"getting-started"},"Getting Started"),(0,n.kt)("p",null,"In the Getting Started, you will set up gha-trigger and experience CI with gha-trigger."),(0,n.kt)("h2",{id:"requirement"},"Requirement"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Git"),(0,n.kt)("li",{parentName:"ul"},"GitHub Account"),(0,n.kt)("li",{parentName:"ul"},"AWS Account"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://www.terraform.io/"},"Terraform"))),(0,n.kt)("h2",{id:"steps"},"Steps"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Create GitHub Repositories from template repositories"),(0,n.kt)("li",{parentName:"ol"},(0,n.kt)("a",{parentName:"li",href:"https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks"},"Create Webhook Secret")),(0,n.kt)("li",{parentName:"ol"},"Set up Terraform Configuration"),(0,n.kt)("li",{parentName:"ol"}
1,"Apply Terraform"),(0,n.kt)("li",{parentName:"ol"},"Create GitHub Apps"),(0,n.kt)("li",{parentName:"ol"},"Set GitHub App ID and Private Key"),(0,n.kt)("li",{parentName:"ol"},"Apply Terraform again"),(0,n.kt)("li",{parentName:"ol"},"Run Manual Workflow"),(0,n.kt)("li",{parentName:"ol"},"Clean up")),(0,n.kt)("h3",{id:"1-create-github-repositories-from-template-repositories"},"1. Create GitHub Repositories from template repositories"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://github.com/gha-trigger/example-main/generate"},"Main Repository")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://github.com/gha-trigger/example-ci/generate"},"CI Repository")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://github.com/gha-trigger/example-manual-workflow/generate"},"Manual Workflow Repository"))),(0,n.kt)("p",null,"And checkout them."),(0,n.kt)("h4",{id:"create-the-remote-branch-pull_request-in-ci-repository"},"Create the remote branch ",(0,n.kt)("inlineCode",{parentName:"h4"},"pull_request")," in ",(0,n.kt)("inlineCode",{parentName:"h4"},"CI Repository"),"."),(0,n.kt)("p",null,"This branch is used to run Workflows via ",(0,n.kt)("inlineCode",{parentName:"p"},"pull_request")," event."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-console"},"$ git checkout -b pull_request\n$ git push origin pull_request\n")),(0,n.kt)("h3",{id:"3-set-up-terraform-configuration"},"3. Set up Terraform Configuration"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-console"},"$ git clone https://github.com/gha-trigger/example-terraform\n$ cd example-terraform\n$ bash download-zip.sh # Download a zip file from Release page\n")),(0,n.kt)("p",null,"Create some files from templates."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-console"},"$ cp config.yaml.tmpl config.yaml\n$ vi config.yaml # Fix Repository owner and name\n\n$ cp secret.yaml.tmpl secret.yaml\n$ vi secret.yaml # Set GitHub App Webhook Secret\n\n$ cp secret_trigger_workflow.yaml.tmpl secret_trigger_workflow.yaml\n")),(0,n.kt)("p",null,"GitHub Apps aren't created yet, so please set dummy strings as GitHub App ID and Private keys at the moment."),(0,n.kt)("h3",{id:"4-appl
1y-terraform"},"4. Apply Terraform"),(0,n.kt)("p",null,"Create resources."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-console"},"$ terraform init\n$ terraform validate\n$ terraform apply\n")),(0,n.kt)("admonition",{type:"caution"},(0,n.kt)("p",{parentName:"admonition"},"Amazon API Gateway is published at the internet and everyone can access it.\n",(0,n.kt)("inlineCode",{parentName:"p"},"gha-trigger")," validates requests so it is dificult for malicious people to run workflows without GitHub Webhook,\nbut it has a risk of DDos Attack.\nWe recommend to delete the endpoint soon when the getting started has been finished.")),(0,n.kt)("h3",{id:"5-create-github-apps"},"5. Create GitHub Apps"),(0,n.kt)("p",null,"Please create GitHub Apps according to ",(0,n.kt)("a",{parentName:"p",href:"/config/github-app"},"the document"),"."),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Create GitHub App"),(0,n.kt)("li",{parentName:"ul"},"Create Private Key"),(0,n.kt)("li",{parentName:"ul"},"Set Permissions & events"),(0,n.kt)("li",{parentName:"ul"},"Install GitHub App to repositories")),(0,n.kt)("h3",{id:"6-set-github-app-id-and-private-key"},"6. Set GitHub App ID and Private Key"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"GitHub Repository Secret",(0,n.kt)("ul",{parentName:"li"},(0,n.kt)("li",{parentName:"ul"},"CI Repository",(0,n.kt)("ul",{parentName:"li"},(0,n.kt)("li",{parentName:"ul"},"APP_ID: GitHub App ID of ",(0,n.kt)("inlineCode",{parentName:"li"},"Trigger CI Workflow App")),(0,n.kt)("li",{parentName:"ul"},"APP_PRIVATE_KEY: GitHub App Private Key of ",(0,n.kt)("inlineCode",{parentName:"li"},"Trigger CI Workflow App")))),(0,n.kt)("li",{parentName:"ul"},"Manual Workflow Repository",(0,n.kt)("ul",{parentName:"li"},(0,n.kt)("li",{parentName:"ul"},"APP_ID: GitHub App ID of ",(0,n.kt)("inlineCode",{parentName:"li"},"Manual Workflow App")),(0,n.kt)("li",{parentName:"ul"},"APP_PRIVATE_KEY: GitHub App Private Key of ",(0,n.kt)("inlineCode",{parentName:"li"},"Manual Workflow App")))))),(0,n.kt)("li",{parentName:"ul"},"config.yaml",(0,n.kt)("ul",{parentName:"li"},(0,n.kt)("li",{parentName:"ul"},"app_id"))),(0,n.kt)("li",{parentName:"ul"},"secret.yaml",(0,n.kt)("ul",{parentName:"li"},(0,n.kt)("li",{parentName:"ul"},"github_app_private_key: GitHub App Private Key of ",(0,n.kt)("inlineCode",{parentName:"li"},"Webhook App")))),(0,n.kt)("li",{parentName:"ul"},"secret_trigger_workflow.yaml",(0,n.kt)("ul",{parentName:"li"},(0,n.kt)("li",{parentName:"ul"},"github_app_private_key: GitHub App Private Key of ",(0,n.kt)("inlineCode",{parentName:"li"},"Trigger CI Workflow App"))))),(0,n.kt)("h3",{id:"7-apply-terraform-again"},"7. Apply Terraform again"),(0,n.kt)("p",null,"After setting GitHub App ID and Private Key, run ",(0,n.kt)("inlineCode",{parentName:"p"},"terraform apply")," again."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-console"},"$ terraform apply\n")),(0,n.kt)("h3",{id:"8-run-manual-workflow"},"8. Run Manual Workflow"),(0,n.kt)("p",null,"You can create a pull request to Main Repository without ",(0,n.kt)("inlineCode",{parentName:"p"},"Manual Workflow"),", but in the getting started let's run ",(0,n.kt)("inlineCode",{parentName:"p"},"Manual Workflow"),"."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-console"},"$ gh workflow run scaffold.yaml -f service=foo\n")),(0,n.kt)("p",null,"Then create a pull request according to the guide in GitHub Actions Step Summary."),(0,n.kt)("p",null,"CI would work in ",(0,n.kt)("inlineCode",{parentName:"p"},"CI Repository")," via ",(0,n.kt)("inlineCode",{parentName:"p"},"gha-trigger"),".\nIf CI doesn't work well, please check Lambda Log."),(0,n.kt)("h2",{id:"10-clean-up"},"10. Clean up"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-console"},"$ terraform destroy\n")))}c.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.