Update deploy.yml #40
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
name: deploy | |
on: | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
branches: | |
- master | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 # Updated to use v3 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0.2' | |
- name: Install deps | |
run: | | |
gem install bundler | |
bundle config path vendor/bundle | |
bundle install --jobs 4 --retry 3 | |
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 | |
echo "SRC_BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV | |
echo "NO_PUSH=--no-push" >> $GITHUB_ENV | |
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then | |
echo "SRC_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | |
fi | |
echo "DEPLOY_BRANCH=gh-pages" >> $GITHUB_ENV | |
- name: Debugging Output | |
run: | | |
echo "SRC_BRANCH=${{ env.SRC_BRANCH }}" | |
echo "NO_PUSH=${{ env.NO_PUSH }}" | |
echo "DEPLOY_BRANCH=${{ env.DEPLOY_BRANCH }}" | |
- name: Deploy website | |
run: yes | bash bin/deploy --verbose ${{ env.NO_PUSH }} \ | |
--src ${{ env.SRC_BRANCH }} \ | |
--deploy ${{ env.DEPLOY_BRANCH }} |