diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages copy.yml similarity index 69% rename from .github/workflows/github-pages.yml rename to .github/workflows/github-pages copy.yml index 50f395b..f511428 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages copy.yml @@ -1,12 +1,17 @@ name: github-pages on: - push: + workflow_run: branches: [main] + workflows: [test] + types: [completed] jobs: main: + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: { node-version: lts/*, cache: yarn } - id: brew_cache run: echo "::set-output name=dir::$(brew --cache)" - uses: actions/cache@v2 @@ -14,16 +19,19 @@ jobs: path: ${{ steps.brew_cache.outputs.dir }} key: brew-${{ hashFiles('**/Brewfile.lock.json') }} restore-keys: brew- - - uses: actions/setup-node@v2 - with: { node-version: lts/*, cache: yarn } - name: Git config run: | git config user.name bot git config user.email bot@example - - run: git subtree add --prefix book origin gh-pages - - run: brew bundle - - run: yarn - - run: yarn build + git subtree add --prefix book origin gh-pages + - name: Build assets + run: | + yarn install + yarn build + - name: Build book + run: | + brew bundle + mdbook build - name: Publish run: | git add -f book diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..25b485b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,11 @@ +name: test +on: push +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: { node-version: lts/*, cache: yarn } + - run: yarn + - run: yarn build diff --git a/package.json b/package.json index be1d990..3adcc03 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "scripts": { - "build": "esbuild src/*.js --outdir=theme --platform=browser --bundle --minify && mdbook build" + "build": "esbuild src/*.js --outdir=theme --platform=browser --bundle --minify" }, "devDependencies": { "esbuild": "^0.12.15", diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..76127f9 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "extends": ["config:base", "config:semverAllMonthly"], + "automerge": true +}