-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
68 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.