[CI/CD] Github - Actions

이정훈·2023년 4월 13일
0

IaC

목록 보기
8/8
post-thumbnail
  • 깃 엑션을 돌리는데 10분만 지나면 타임아웃 에러가 발생해서 작업들을 수행하다가 멈춰버렸다.
  • 기본 깃 엑션 수행 시간 값은 10분이고 이거를 임의적으로 30분 늘려주었다.

name: 'Deploy'

on:
push:
branches: [ "master" ]
pull_request:

permissions:
contents: read

jobs:
deploy:
name: 'Deploy'
runs-on: ubuntu-latest
environment: production
timeout-minutes: 30

defaults:
run:
shell: bash

steps:

# Checkout the repository to the GitHub Actions runner
- name: Checkout
  uses: actions/checkout@v3
- name: SSH Commands
  uses: appleboy/ssh-action@v0.1.6
  with:
    host: ${{ secrets.AWS_SSH_HOST }}
    username: ${{ secrets.AWS_SSH_USERNAME }}
    key: ${{ secrets.AWS_SSH_KEY }}
    port: ${{ secrets.AWS_SSH_PORT }}
    command_timeout: 1h
    script_stop: true
    script: |
      sudo rm -rf tmp
      sudo git clone https://github.com/gugucone999/mini.git tmp
      sudo cp -r tmp/* project/
      sudo ls -al project
      sudo -s sh project/run.sh
      sudo rm -rf tmp
profile
싱숭생숭늉

0개의 댓글