-
Notifications
You must be signed in to change notification settings - Fork 40
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
7 changed files
with
69 additions
and
9 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
on: push | ||
name: Test and deploy | ||
on: push | ||
jobs: | ||
install: | ||
name: Install | ||
|
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 |
---|---|---|
@@ -1,18 +1,26 @@ | ||
name: Run health check | ||
on: | ||
schedule: | ||
- cron: 0 0 * * * | ||
name: Run daily test | ||
jobs: | ||
install: | ||
name: Install | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Only master | ||
uses: actions/bin/filter@25b7b846d5027eac3315b50a8055ea675e2abd89 | ||
with: | ||
args: branch master | ||
- uses: actions/checkout@master | ||
- name: Install | ||
uses: actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680 | ||
with: | ||
args: install | ||
- name: Run testcases | ||
- name: Run health check | ||
uses: actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680 | ||
with: | ||
args: test:health-check | ||
- name: Push health check | ||
uses: ./actions/push-health-check | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
FROM node:9 | ||
LABEL "version"="0.0.7" | ||
FROM node:12 | ||
LABEL "version"="0.0.8" | ||
LABEL "com.github.actions.name"="Deploy" | ||
LABEL "com.github.actions.description"="Deploy just-news" | ||
LABEL "com.github.actions.icon"="archive" | ||
LABEL "com.github.actions.color"="orange" | ||
|
||
LABEL "repository"="https://github.com/disjukr/just-news/actions/deploy" | ||
LABEL "homepage"="https://github.com/disjukr/just-news/actions/deploy" | ||
LABEL "maintainer"="item4 <[email protected]>" | ||
LABEL "maintainer"="JongChan Choi <[email protected]>" | ||
|
||
ADD entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
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 |
---|---|---|
|
@@ -40,4 +40,3 @@ echo "git push origin release" | |
git push origin release | ||
echo "popd" | ||
popd | ||
|
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,13 @@ | ||
FROM node:12 | ||
LABEL "version"="0.0.0" | ||
LABEL "com.github.actions.name"="Push health check" | ||
LABEL "com.github.actions.description"="Push health check" | ||
LABEL "com.github.actions.icon"="archive" | ||
LABEL "com.github.actions.color"="orange" | ||
|
||
LABEL "repository"="https://github.com/disjukr/just-news/actions/deploy" | ||
LABEL "homepage"="https://github.com/disjukr/just-news/actions/deploy" | ||
LABEL "maintainer"="JongChan Choi <[email protected]>" | ||
|
||
ADD entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
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,38 @@ | ||
#!/bin/bash | ||
RELEASE_DIR=../just-news-push-health-check | ||
BUILD_DIR=$(pwd) | ||
|
||
echo "npm run test:health-check" | ||
npm run test:health-check | ||
|
||
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc | ||
git config --global user.name "just-news-bot" | ||
git config --global user.email "[email protected]" | ||
git config --bool core.bare true | ||
|
||
echo "git clone release" | ||
git clone https://github.com/disjukr/just-news.git $RELEASE_DIR | ||
echo "pushd to RELEASE_DIR" | ||
pushd $RELEASE_DIR | ||
|
||
echo "git checkout release" | ||
git checkout health-check | ||
|
||
echo "copy files" | ||
cp $BUILD_DIR/tmp/health-check.md health-check.md | ||
cp $BUILD_DIR/tmp/health-check.png health-check.png | ||
echo "git add -f ." | ||
git add -f . | ||
|
||
echo "check git status" | ||
git status | ||
if git status | grep 'no changes added to commit'; then | ||
exit | ||
fi | ||
|
||
echo "git commit" | ||
git commit -m "$(date)" | ||
echo "git push origin health-check" | ||
git push origin health-check | ||
echo "popd" | ||
popd |
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