Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/update-blog.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ update-blog ]
pull_request:
branches: [ update-blog ]
# schedule:
# - cron: "0 2 * * 1-5"

jobs:
build:
env:
YEAR: 2021
SOURCE_DIR: ../../TIL/
TARGET_DIR: ./private/_posts/

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

defaults:
run:
working-directory: ./scripts/blog-updater

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1 # use v1 while subdirectory not supported
with:
node-version: ${{ matrix.node-version }}
# cache: 'npm'
# working-directory: ./scripts/blog-updater # subdirectory not yet supported: https://github.com/actions/setup-node/pull/299
- name: test
run: npm ci && npm test
- name: process posts
run: npm run process
- name: public to blog
env:
API_TOKEN_GITHUB: ${{ secrets.UPDATE_BLOG }}
run: |
git clone https://epikem:$GITHUB_TOKEN@github.com/epikem/epikem.github.io

cd epikem.github.io
git config user.name "epikem"
git config user.email "epikem@kakao.com"

git checkout update-blog
pwd
cp -R ../private/_posts/$YEAR ./_posts

git add .
git commit -m "copy posts from dev-tips $(date +'%Y-%m-%d')"
- name: GitHub Push
uses: ad-m/github-push-action@v0.6.0
with:
directory: ./scripts/blog-updater/epikem.github.io/
github_token: ${{ secrets.UPDATE_BLOG }}
branch: update-blog
repository: epikem/epikem.github.io
2 changes: 1 addition & 1 deletion TIL/2021-07-12.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

조합 출력하기와 다루기가 좀 까다로운 문제


s
#### 순위 검색 (72412)

저번에도 그렇고 이분 탐색이 생각이 안났다.
Expand Down
4 changes: 4 additions & 0 deletions scripts/blog-updater/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
src/test-*
20*
*copy*
Loading