Skip to content

Commit

Permalink
Replace bin/deploy with GitHub Action (alshedivat#1234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demi-wlw authored Mar 19, 2023
1 parent fcd2cfc commit 92bf148
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,28 @@ on:
branches:
- master
- main
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.2'
ruby-version: '3.2.1'
bundler-cache: true
- name: Install deps
- name: Install and Build 🔧
run: |
npm install -g mermaid.cli
- name: Setup deploy options
id: setup
run: |
git config --global user.name "GitHub Action"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then # pull request
echo "SRC_BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT
echo "NO_PUSH=--no-push" >> $GITHUB_OUTPUT
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc
echo "SRC_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
fi
echo "DEPLOY_BRANCH=gh-pages" >> $GITHUB_OUTPUT
- name: Deploy website
run: yes | bash bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }}
--src ${{ steps.setup.outputs.SRC_BRANCH }}
--deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }}
bundle exec jekyll build
- name: Deploy 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site

0 comments on commit 92bf148

Please sign in to comment.