diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index c78502f480c8..cb78f6d90bf1 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -3,7 +3,7 @@ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username -ko_fi: alshedivat +ko_fi: # alshedivat tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username diff --git a/.github/workflows/deploy - Copy.yml b/.github/workflows/deploy - Copy.yml new file mode 100644 index 000000000000..0fc24dcdc824 --- /dev/null +++ b/.github/workflows/deploy - Copy.yml @@ -0,0 +1,51 @@ +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@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- + - 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" + elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc + echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}" + fi + echo "::set-output name=DEPLOY_BRANCH::gh-pages" + - name: Deploy website + run: yes | bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }} + --src ${{ steps.setup.outputs.SRC_BRANCH }} + --deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0fc24dcdc824..07da4dfc3533 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy +name: deploy on: push: @@ -9,43 +9,40 @@ on: branches: - master - main + workflow_dispatch: + +permissions: + contents: write jobs: deploy: + # available images: https://github.com/actions/runner-images#available-images runs-on: ubuntu-latest 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- - - 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" - elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc - echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}" - fi - echo "::set-output name=DEPLOY_BRANCH::gh-pages" - - name: Deploy website - run: yes | bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }} - --src ${{ steps.setup.outputs.SRC_BRANCH }} - --deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }} + - name: Checkout 🛎️ + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2.2" + bundler-cache: true + - name: Update _config.yml ⚙️ + uses: fjogeleit/yaml-update-action@v0.13.1 + with: + commitChange: false + valueFile: "_config.yml" + propertyPath: "giscus.repo" + value: ${{ github.repository }} + - name: Install and Build 🔧 + run: | + pip3 install --upgrade jupyter + npm install -g mermaid.cli + npm install -g purgecss + export JEKYLL_ENV=production + bundle exec jekyll build --lsi + purgecss -c purgecss.config.js + - name: Deploy 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: _site \ No newline at end of file