Skip to content

Commit

Permalink
chore: 자동빌드 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ljh0608 authored Jul 18, 2024
1 parent 44e9a30 commit d846141
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 31 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
pull_request:
branches: ['main']
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: yarn install

- name: Build # 빌드
run: yarn build

- name: Close PR, if build fails
if: ${{ failure() }}
uses: actions/github-script@v6
with:
github-token: ${{ github.TOKEN }}
script: |
const pull_number = ${{ github.event.pull_request.number }}
const updated_title = `[BUILD FAIL] ${{ github.event.pull_request.title }}`
await github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull_number,
body: '빌드에 실패했습니다.',
event: 'REQUEST_CHANGES'
})
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull_number,
title: updated_title,
state: 'closed'
})
push_main:
runs-on: ubuntu-latest
container: pandoc/latex
steps:
- uses: actions/checkout@v2
- name: Install mustache (to update the date)
run: apk add ruby && gem install mustache
- name: creates output
run: sh ./build.sh
- name: Pushes to another repository
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }}
with:
source-directory: 'output'
destination-github-username: ljh0608
destination-repository-name: ASAP_Client
user-email: ${{ secrets.LEAD_EMAIL }}
commit-message: ${{ github.event.commits[0].message }}
target-branch: main
- name: Test get variable exported by push-to-another-repository
run: echo $DESTINATION_CLONED_DIRECTORY
31 changes: 0 additions & 31 deletions .github/workflows/deploy.yml

This file was deleted.

0 comments on commit d846141

Please sign in to comment.