Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LoickCh authored Oct 8, 2024
1 parent ce95e69 commit 552723b
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,48 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.2'
- name: Enable bundler cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-

# Temporarily comment out caching for debugging
# - name: Enable bundler cache
# uses: actions/cache@v2
# with:
# path: vendor/bundle
# key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-gems-

- 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 # pull request
echo "::set-output name=SRC_BRANCH::${GITHUB_HEAD_REF}"
echo "::set-output name=NO_PUSH::--no-push"
echo "SRC_BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
echo "NO_PUSH=--no-push" >> $GITHUB_ENV
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc
echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}"
echo "SRC_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
fi
echo "::set-output name=DEPLOY_BRANCH::gh-pages"
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 ${{ steps.setup.outputs.NO_PUSH }}
--src ${{ steps.setup.outputs.SRC_BRANCH }}
--deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }}
run: yes | bash bin/deploy --verbose ${{ env.NO_PUSH }} \
--src ${{ env.SRC_BRANCH }} \
--deploy ${{ env.DEPLOY_BRANCH }}

0 comments on commit 552723b

Please sign in to comment.