๐Ÿ“—
smiley book
  • Smiley Books
  • AI
    • Readme
    • openai-whisper
      • ์ƒ˜ํ”Œ ์‹คํ–‰ํ•ด๋ณด๊ธฐ
      • GPU ์„œ๋ฒ„ ์ค€๋น„ํ•˜๊ธฐ
      • API๋กœ whisper๋ฅผ ์™ธ๋ถ€์— ์˜คํ”ˆํ•˜๊ธฐ
      • ํ”„๋กฌํ”„ํŠธ ์ง€์›
      • ์‹ค์‹œ๊ฐ„ message chat
      • ํ™”๋ฉด ์ด์˜๊ฒŒ ๋งŒ๋“ค๊ธฐ์™€ ๋กœ๊ทธ์ธ
      • ํŒŒ์ด์ฌ ๊ฐ€์ƒํ™˜๊ฒฝ
      • ์‹ค์‹œ๊ฐ„ voice chat
      • fine tunning(๋ฏธ์„ธ ์กฐ์ •) ์œผ๋กœ ์„ฑ๋Šฅ ์˜ฌ๋ฆฌ๊ธฐ
      • app์—์„œ api๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์‹ค์‹œ๊ฐ„์œผ๋กœ ํ…์ŠคํŠธ๋กœ ๋ฐ”๊ฟ”๋ณด๊ธฐ
    • ollama - llm์„ ์‰ฝ๊ฒŒ ๋‚ด์ปด์—์„œ ์‹คํ–‰
      • ollama webui
      • ollama docker
    • stable diffusion
      • SDXL - text to image
      • SD-webui
    • ChatGPT
      • ๋‹ต๋ณ€์ด ๋Š๊ธธ๋•Œ
      • ์—ญํ• ์„ ์ •ํ•˜์ž
      • ๊ตฌ์ฒด์ ์ธ ์งˆ๋ฌธ
      • ๊ฒฐ๊ณผํ˜•ํƒœ๋ฅผ ์ง€์ •
      • ํ”„๋กฌํ”„ํŠธ๋ฅผ ์—ฌ๋Ÿฌ์ค„๋กœ ์‚ฌ์šฉํ•˜์ž.
      • ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ ๊ธ€ ๋ฒˆ์—ญ๋ณธ
    • Prompt Engineering
    • Auto-GPT
    • Gemini
      • google ai studio
      • gemini-api
      • embedding guide
    • Huggingface
      • huggingface ์‚ฌ์šฉ๋ฒ•
      • huggingface nlp ๊ณต๋ถ€์ค‘
    • kaggle
      • download dataset
    • langchain
      • langchain์„ ๊ณต๋ถ€ํ•˜๋ฉฐ ์ •๋ฆฌ
      • basic
      • slackbot
      • rag
      • document-loader
      • website-loader
      • confluence
      • memory
      • function-call
      • langsmith
      • agent-toolkit
  • Ansible
    • templates vs files and jinja2
    • dynamic inventory
    • limit ์˜ต์…˜ ๊ฐ•์ œํ•˜๊ธฐ
    • limit ์‚ฌ์šฉํ›„ gather_fact ๋ฌธ์ œ
  • AWS
    • AWS CLI
    • EKS
      • cluster manage
      • ALB Controller
      • external-dns
      • fargate
    • ECR
    • S3
    • Certificate Manager
  • Azure
    • Azure AD OAuth Client Flow
  • Container
    • Registry
    • ๋นŒ๋“œ์‹œ์— env๊ฐ’ ์„ค์ •ํ•˜๊ธฐ
  • DB
    • PXC
      • Operator
      • PMM
      • ์‚ญ์ œ
      • GTID
      • Cross Site Replication
    • Mssql
    • Mysql
  • dotnet
    • Thread Pool
    • Connection Pool
    • Thread Pool2
  • Devops
    • Recommendation
  • GIT
    • Basic
    • Submodule
  • GitHub
    • Repository
    • GitHub Action
    • GitHub PR
    • Self Hosted Runner
    • GitHub Webhook
  • GitLab
    • CI/CD
    • CI/CD Advance
    • Ssl renew
    • CI/CD Pass env to other job
  • Go Lang
    • ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ•
    • multi os binary build
    • kubectl๊ฐ™์€ cli๋งŒ๋“ค๊ธฐ
    • azure ad cli
    • embed static file
    • go study
      • pointer
      • module and package
      • string
      • struct
      • goroutine
  • Kubernetes
    • Kubernetes๋Š” ๋ฌด์—‡์ธ๊ฐ€
    • Tools
    • Install with kubespray
    • Kubernetes hardening guidance
    • 11 ways not to get hacked
    • ArgoCD
      • Install
      • CLI
      • Repository
      • Apps
      • AWS ALB ์‚ฌ์šฉ
      • Notification slack
      • Backup / DR
      • Ingress
      • 2021-11-16 Github error
      • Server Config
      • auth0 ์ธ์ฆ ์ถ”๊ฐ€(oauth,OIDC)
    • Extension
      • Longhorn pvc
      • External dns
      • Ingress nginx
      • Cert Manager
      • Kube prometheus
    • Helm
      • Subchart
      • Tip
    • Loki
    • Persistent Volume
    • TIP
      • Job
      • Pod
      • Log
  • KAFKA
    • raft
  • KVM
    • kvm cpu model
  • Linux
    • DNS Bind9
      • Cert-Manager
      • Certbot
      • Dynamic Update
      • Log
    • Export and variable
    • Grep ์‚ฌ์šฉ๋ฒ•
  • Modeling
    • C4 model introduce
    • Mermaid
    • reference
  • Monitoring
    • Readme
    • 0. What is Monitoring
    • 1. install prometheus and grafana
    • 2. grafana provisioning
    • 3. grafana dashboard
    • 4. grafana portable dashboard
    • 5. prometheus ui
    • 6. prometheus oauth2
    • Prometheus
      • Metric type
      • basic
      • rate vs irate
      • k8s-prometheus
    • Grafana
      • Expolorer
    • Node Exporter
      • advance
      • textfile collector
  • Motivation
    • 3 Simple Rule
  • OPENNEBULA
    • Install(ansible)
    • Install
    • Tip
    • Windows vm
  • Reading
    • comfort zone
    • ๋ฐฐ๋ ค
    • elon musk 6 rule for insane productivity
    • Feynman Technique
    • how to interview - elon musk
    • ๊ฒฝ์ฒญ
    • Readme
  • Redis
    • Install
    • Master-slave Architecture
    • Sentinel
    • Redis Cluster
    • Client programming c#
  • SEO
    • Readme
  • Security
    • criminalip.io
      • criminalip.io
  • Stock
    • robinhood-python
  • Terraform
    • moved block
    • output
  • vault
    • Readme
  • VS Code
    • dev container
    • dev container on remote server
  • Old fashione trend
    • curity
    • MAAS
      • Install maas
      • Manage maas
      • Tip
Powered by GitBook
On this page
  • workflows
  • sample project ์ƒ์„ฑ
  • ์†Œ์Šค์ฝ”๋“œ๋ฅผ checkout
  • build
  • artifact (๊ฒฐ๊ณผ๋ฌผ)์„ ๋ฐ›์•„๋ณด์ž
  • main๋ธŒ๋žœ์น˜ ๋ง๊ณ  dev๋ธŒ๋žœ์น˜
  • [ci skip]
  • s3 ์—…๋กœ๋“œ
  • argocd์ฒ˜๋Ÿผ ๋‹ค๋ฅธ github ํ”„๋กœ์ ํŠธ์— ์ปค๋ฐ‹ํ•˜๊ธฐ
  • ์ „์ฒด ์•ต๊ทค๋Ÿฌ ๋นŒ๋“œ ํŒŒ์ผ

Was this helpful?

  1. GitHub

GitHub Action

github action์ด ๋ญ๋ƒ...์ฝ”๋“œ๋ฅผ ์ปค๋ฐ‹/ํ‘ธ์‹œ ํ•˜๋ฉด ๊ทธ ํ›„์— ๋ญ”๊ฐ€๋ฅผ ํ•˜๊ณ  ์‹ถ๋‹ค. ci/cd ๋“ฑ๋“ฑ ๊ผญ ci/cd๊ฐ€ ์•„๋‹ˆ๋”๋ผ๊ณ  ์ปดํŒŒ์ผํ›„ ์ปดํŒŒ์ผ๋œ ํŒŒ์ผ์„ ๋ฐ›์•„๋ณด๊ณ  ์‹ถ๊ฑฐ๋‚˜ s3์— ์˜ฌ๋ฆฌ๊ณ  ์‹ถ๋‹ค ๋“ฑ์˜ ๋ฌด์Šจ์ผ์ด๋“  ํ•˜๊ณ  ์‹ถ์€ ๊ฑธ ์ž๋™ํ™” ํ•ด์ฃผ๋Š” ํˆด์ด๋‹ค.

gitlab ci/cd๋„ ๊ฐ™์€ ๊ธฐ๋Šฅ์„ ํ•œ๋‹ค. ์ €๋Š” gitlab ci/cd๊ฐ€ ๋„ˆ๋ฌด ์ข‹์•„์„œ ๊ทธ๊ฒƒ๋งŒ ์ผ๋Š”๋ฐ ์ด๋ฒˆ์— github๋ฅผ ์จ์•ผํ• ์ผ์ด ์ƒ๊ฒจ์„œ ํ™•์ธํ•ด๋ดค๋”๋‹ˆ gitlab์˜ ๊ธฐ๋Šฅ์„ ๋Œ€๋ถ€๋ถ„ ๊ฐ€์ ธ์„œ ๊ตฌํ˜„ํ•ด ๋‘ฟ๋‹ค.

์—ญ์‹œ ์ด๋ฐ”๋‹ฅ์€ ์ข‹์€๊ธฐ๋Šฅ์€ ๋‹ค ๋ฒ ๋ผ๋Š”..^^ ์ฐธ๊ณ ๋กœ gitlab ci/cd๊ฐ€ ๋จผ์ € ๋‚˜์™”๋‹ค.

ํ•ด๋ณด์ž.

workflows

ํ”„๋กœ์ ํŠธ์— .github/workflows ๋ผ๋Š” ํด๋”๋ฅผ ๋งŒ๋“ค๊ณ  ๊ฑฐ๊ธฐ์— build.yml์„ ๋งŒ๋“ค์–ด ๋ณด์ž.

cd ~/Desktop/demo-angular
mkdir -p .github/workflows
touch .github/workflows/build.yml
.github/workflows/build.yml
name: CI

on:
  push:
    branches: [main, dev]
  pull_request:
    branches: [main, dev]

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: ls -alF
        run: |
          ls -alF
          pwd

์ด์ œ ์ปค๋ฐ‹ ํ‘ธ์‹œํ•ด๋ณด์ž.

github์›น์‚ฌ์ดํŠธ์— actionํŽ˜์ด์ง€์— ๊ฐ€๋ณด์ž.

์•ˆ๋ณด์ด๋˜๊ฒŒ ์ƒ๊ธฐ๊ณ  ์„ฑ๊ณตํ–‡๋‹ค๊ณ  ๋ณด์—ฌ์ค€๋‹ค.

ํ™•์ธํ•ด๋ณด์ž. create build.yml์„ ํด๋ฆญ

ํ™”๋ฉด์„ ๋ณด๋ฉด ls -alF๋ฅผ ํ–ˆ๊ณ  pwd๋ฅผ ํ•ด์„œ ํ˜„์žฌ ํด๋”๋ฅผ ํ”„๋ฆฐํŠธ ํ–‡๋‹ค.

์ปค๋ฐ‹์‹œ ๋ญ”๊ฐ€๋ฅผ ํ•ด๋ณด๋Š”๊ฑฐ๊นŒ์ง€๋Š” ์„ฑ๊ณต

yml์„ ์„ค๋ช…์„ ์ข€ ํ•ด๋ณด๋ฉด

on:
  push:
    branches: [main, dev]
  pull_request:
    branches: [main, dev]

push๋‚˜ Pull_request์— main ๋ธŒ๋žœ์น˜๋‚˜ dev๋ธŒ๋žœ์น˜์—๋งŒ ์ด workflow๊ฐ€ ๋™์ž‘ํ•œ๋‹ค.

์ด๋ฏธ์ง€๋Š” ubuntu-latest ๋ฅผ ๊ฐ€์ง€๊ณ  ๋นŒ๋“œ๋ฅผ ์‹œ์ž‘ํ•œ๋‹ค.

name์€ ์‚ฌ๋žŒ๋“ค์ด ๋ณด๊ธฐ ํŽธํ•˜๊ฒŒ ์จ์ฃผ๋ฉด ๋ ๊ฑฐ๊ฐ™๊ณ  run์œผ๋กœ ์‹ค์ œ ์ปค๋งจ๋“ค๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

๋Œ€์ถฉ ์ดํ•ดํ–‡์œผ๋‹ˆ ๋‹ค์Œ๋‹จ๊ณ„๋กœ ๊ฐ€๋ณด์ž.

sample project ์ƒ์„ฑ

ํ”„๋กœ์ ํŠธ์— angular ๋ฅผ ํ•˜๋‚˜ ์ถ”๊ฐ€ํ•ด๋ณด์ž.

cd Desktop/GitHub
ng new github-action
cd github-action
nb build --prod

์ปค๋ฐ‹/push

์†Œ์Šค์ฝ”๋“œ๋ฅผ checkout

- name: Checkout
  uses: actions/checkout@v2

์ถ”๊ฐ€ํ•˜๊ณ  ์ปค๋ฐ‹/ํ‘ธ์‹œ ํ•ด๋ณด์ž.

runner๊ฐ€ git checkout ์„ ํ•˜๊ณ  ls -alF๋ฅผ ํ•ด์„œ ๋‚ด์šฉ์ด ํ™•์ธ๋œ๋‹ค.

build

  1. nodejs 12 ๋ฒ„์ „์„ ์ด์šฉ

  2. @angular/cli ๊ฐ€ ๊ธ€๋กœ๋ฒŒ๋กœ ์„ค์น˜

  3. npm package install

  4. project build

- name: Checkout
  uses: actions/checkout@v2

- name: Node 12.x
  uses: actions/setup-node@v2.1.5
  with:
    node-version: '12.x'

- name: install @angular/cli && npm install && ng build
  run: |
    npm install -g @angular/cli
    npm install
    ng build --prod

์ปค๋ฐ‹/ํ‘ธ์‹œ ํ•˜๊ณ  ์•ก์…˜์„ ์ฒดํฌํ•ด๋ณด์ž.

์„ค๋ช…์„ ํ•˜๋ฉด actions/setup-node@v2.1.5 ์ด๊ฒƒ๋งŒ ์„ค๋ช…ํ•˜๋ฉด๋ ๋“ฏ ์‹ถ๋‹ค.

github action์€ ๋งˆ์ผ“ ํ”Œ๋ ˆ์ด์Šค์— ์‚ฌ๋žŒ๋“ค์ด ๋งŒ๋“ค์–ด์„œ ํŠน์ • ์•ก์…˜์„ ๊ณต์œ ํ•ด๋‘”๊ณณ์ด ์žˆ๋‹ค. ์•„์ฃผ ๋งŽ์€ ๋ถ€๋ถ„๋“ค์ด ๋ฒŒ์จ ๋งŒ๋“ค์–ด์ ธ ์žˆ์–ด์„œ ๊ทธ๊ฑธ ๊ฐ€์ ธ๋‹ค ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ์–ด์„œ ์•„์ฃผ ํŽธํ•˜๋‹ค. ๊ฐœ์ธ๋“ค์ด ๋งŒ๋“ ๊ฒƒ๋„ ์žˆ๊ณ  ํŠน๋ณ„ํ•œ๊ฒƒ๋“ค์€ ๊นƒํ—ˆ๋ธŒ์—์„œ ์ง์ ‘ ๋งŒ๋“ค์–ด๋‘”๊ฒŒ ์žˆ๋‹ค.

์œ„ ์ปค๋งจ๋“œ๋Š” nodejsํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•ด์ฃผ๋Š” ์•ก์…˜์ธ๋ฐ ๊ฐ€์ ธ๋‹ค ์“ฐ๋ฉด ๋œ๋‹ค.

๋งˆ์ง€๋ง‰ @ ๋‹ค์Œ์—๋Š” ๋ฒ„์ „์„ ์“ฐ๋ฉด๋˜๋Š”๋ฐ ์ตœ์‹  ๋‚ด์šฉ์„ ๋ณด๊ณ ์‹ถ์œผ๋ฉด ๊นƒํ—™ ํŽ˜์ด์ง€๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด ๋œ๋‹ค.

๋ฒ„์ „์„ ๊ณจ๋ผ์„œ ์‚ฌ์šฉํ•˜๋ฉด๋œ๋‹ค.

๋นŒ๋“œ๊ฐ€ ์™„๋ฃŒ๋ฌ์œผ๋‹ˆ ํ™•์ธํ•ด๋ณด์ž.

node 12.x๊ฐ€ ์ž˜ ์„ค์น˜๊ฐ€ ๋˜์—ˆ์œผ๋ฉฐ ์ปค๋งจ๋“œ๋“ค๋„ ์ž˜ ์‹คํ–‰์ด ๋œ๊ฒƒ์„ ๋ณผ์ˆ˜ ์žˆ๋‹ค.

artifact (๊ฒฐ๊ณผ๋ฌผ)์„ ๋ฐ›์•„๋ณด์ž

๋นŒ๋“œํ•˜๊ณ ๋‚˜๋ฉด distํด๋”์— ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ๊ธด๋‹ค ์ด๊ฑธ ์•ก์…˜ ํŽ˜์ด์ง€์—์„œ ๋‹ค์šด๋ฐ›์„์ˆ˜ ์žˆ๊ฒŒ ํ•ด๋ณด์ž.

- name: install @angular/cli && npm install && ng build && cd dist
  run: |
    sudo npm install -g @angular/cli
    npm install
    ng build --prod
    pwd
    ls

- uses: actions/upload-artifact@v2
  with:
    name: github-action
    path: dist/github-action/

ํ˜„์žฌ ์œ„์น˜๋ฅผ ์•Œ๊ธฐ ์œ„ํ•ด pwd ์™€ ls๋ฅผ ์‹คํ–‰ํ•ด๋ดค๋‹ค.

ํ•ด๋ณด์ž.

ํ˜„์žฌ ํด๋”๋ฅผ /home/runner/work/github-action/github-action ์ด๊ณ  dist๊ฐ€ ๋นŒ๋“œ๋˜์„œ ์ƒ์„ฑ๋œ๊ฒƒ์„ ํ™•์ธํ• ์ˆ˜ ์žˆ๋‹ค.

Artifact๊ฐ€ ์—…๋กœ๋“œ ๋œ๊ฒƒ์„ ์•Œ์ˆ˜ ์žˆ๋‹ค.

ํด๋ฆญํ•ด์„œ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์•„์„œ ๋‚ด์šฉ์„ ํ™•์ธํ•ด๋ณด์ž.

์ •ํ™•ํžˆ ๋นŒ๋“œ๋œ๊ฒƒ์„ ์•Œ์ˆ˜ ์žˆ๋‹ค.

๋Œ€์ถฉ ์ด์ •๋„๋กœ ์“ฐ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€๋กœ ๋ญ๋ฅผ ํ•ด๋ณผ๊ฐ€?

๋นŒ๋“œํ›„ s3์— ์—…๋กœ๋“œ๋ฅผ ํ•ด๋ณผ๊ฐ€์š”?

main๋ธŒ๋žœ์น˜ ๋ง๊ณ  dev๋ธŒ๋žœ์น˜

์ผ๋‹จ ํ”„๋กœ์ ํŠธ์— dev ๋ธŒ๋žœ์น˜๋ฅผ ๋งŒ๋“ ๋‹ค.

on:
  push:
    branches: [main, dev]
  pull_request:
    branches: [main, dev]

dev์‹œ์— ํŠธ๋ฆฌ๊ฑฐ๊ฐ€ ๋ ์ˆ˜์žˆ๊ฒŒ ์ถ”๊ฐ€ํ•ด์ค€๋‹ค.

์ฐธ๊ณ ๋กœ ํŠน์ • ์•ก์…˜์ด ํŠน์ • ๋ธŒ๋žœ์น˜์—๋งŒ ์‹คํ–‰์ด ๋˜์•ผํ•˜๋ฉด if๋ฅผ ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๋‹ค. if: github.ref == 'refs/heads/dev'

- name: replace staging image version number to sha
  if: github.ref == 'refs/heads/dev'
  run: |
    cd apps/w2ps-staging

[ci skip]

commit ์— [ci skip]์„ ๋ณด๋‚ด๋ฉด ci๋ฅผ ์Šคํ‚ตํ• ์ˆ˜ ์žˆ๋‹ค.

s3 ์—…๋กœ๋“œ

์ผ๋‹จ ๋งˆ์ผ“ ํ”Œ๋ ˆ์ด์Šค์—์„œ s3๊ด€๋ จ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์ฐพ๋Š”๋‹ค.

์ด๊ฒŒ ์ข‹์„๊ฑฐ๊ฐ™๋‹ค.

ํ•ด๋ณด์ž.

s3์— ๋ฒ„ํ‚ท์„ ํ•˜๋‚˜ ๋งŒ๋“ค์–ด๋‘๊ณ  ์œ ์ €๋ฅผ ์ƒ์„ฑํ•ด์„œ s3 full๊ถŒํ•œ์„ ์ค€๋‹ค.

- uses: jakejarvis/s3-sync-action@v0.5.1
  with:
    args: --acl public-read --follow-symlinks --delete
  env:
    AWS_S3_BUCKET: BUCKET_NAME
    AWS_ACCESS_KEY_ID: YOUR_KEY
    AWS_SECRET_ACCESS_KEY: YOUR_ACCESS
    AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
    SOURCE_DIR: 'dist/github-action/' # optional: defaults to entire repository

์ด์ •๋„ ํ•˜๋ฉด s3๋กœ ์—…๋กœ๋“œ๊ฐ€ ๋œ๋‹ค.

argocd์ฒ˜๋Ÿผ ๋‹ค๋ฅธ github ํ”„๋กœ์ ํŠธ์— ์ปค๋ฐ‹ํ•˜๊ธฐ

๋นŒ๋“œํ•˜๊ณ  artifact๋ฅผ ์—…๋กœ๋“œ ํ•˜๊ณ  argocd์— ํ”„๋กœ์ ํŠธ์— ์ปค๋ฐ‹์„ ํ•ด์•ผํ•˜๋Š”๊ฒฝ์šฐ ์ƒˆํ”„๋กœ์ ํŠธ๋ฅผ ๋‹ค์‹œ ์ฒดํฌ์•„์›ƒ ๋ฐ›๊ณ  ํ•„์š”ํ•œ ์ž‘์—…์„ ํ•˜๊ณ  ๋‚œํ›„ ๋‹ค์‹œ ์ปค๋ฐ‹ํ•˜๋ฉด๋œ๋‹ค.

์—ฌ๊ธฐ์—์„œ PAT๋ผ๋Š”๊ฒŒ ์ž‡๋Š”๋ฐ ์ด๊ฑด github person access token์ด๋ผ๋Š”๊ฒƒ์ด๋‹ค. user >> setting์— ๊ฐ€๋ฉด

developer setting์ด ์ž‡๋Š”๋ฐ ๊ทธ๊ฑธ ๋ˆ„๋ฅด๋ฉด access token์„ ๋งŒ๋“ค์ˆ˜ ์žˆ๋‹ค. ๋งŒ๋“ค๋•Œ ๊ถŒํ•œ์„ ์ค˜์•ผํ•˜๋Š”๋ฐ repo์ •๋„๋ฉด ์ถฉ๋ถ„ํ•ด๋ณด์ธ๋‹ค. ์ƒ์„ฑํ›„ $ ๋„ค ๋„ฃ์–ด์ฃผ๊ฑฐ๋‚˜ setting์— ๋„ฃ์–ด์ค˜๋„ ๋œ๋‹ค.

- name: Checkout argocd
  uses: actions/checkout@v2
  with:
    repository: wnwusa/argocd
    token: ${{ secrets.PAT }}

- name: replace staging image version number to sha
  if: github.ref == 'refs/heads/dev'
  run: |
    cd apps/staging
    sed "s/:latest/:${{ github.sha }}/g" 21.deployment-php.origin > 21.deployment-php.yml

- name: replace production image version number to sha
  if: github.ref == 'refs/heads/master'
  run: |
    cd apps/prod
    sed "s/:latest/:${{ github.sha }}/g" 21.deployment-php.origin > 21.deployment-php.yml

- name: Commit files
  run: |
    git config --local user.email "action@github.com"
    git config --local user.name "GitHub Action"
    git commit -am "change docker tag"
    git push

์ „์ฒด ์•ต๊ทค๋Ÿฌ ๋นŒ๋“œ ํŒŒ์ผ

name: Build
on:
  push:
    branches: [main, dev]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Node 12.x
        uses: actions/setup-node@v2.1.5
        with:
          node-version: '12.x'

      - name: install @angular/cli && npm install
        if: github.ref == 'refs/heads/dev'
        run: |
          npm install -g @angular/cli
          npm install

      - name: npm run build:staging
        if: github.ref == 'refs/heads/dev'
        run: |
          npm run build:staging
          cd dist
          pwd
          ls

      - name: npm run build:production
        if: github.ref == 'refs/heads/main'
        run: |
          npm run build:production

      - uses: actions/upload-artifact@v2
        with:
          name: github-action
          path: dist/

      - uses: jakejarvis/s3-sync-action@v0.5.1
        with:
          args: --acl public-read --follow-symlinks --delete
        env:
          AWS_S3_BUCKET: pickeatup-admin
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
          AWS_REGION: 'us-west-1'
          SOURCE_DIR: 'dist/' # optional: defaults to entire repository
PreviousRepositoryNextGitHub PR

Last updated 1 year ago

Was this helpful?

https://github.com/marketplace?type=actions
https://github.com/marketplace/actions/s3-sync