Skip to content

Bump actions/checkout from 3 to 4 (#194) #440

Bump actions/checkout from 3 to 4 (#194)

Bump actions/checkout from 3 to 4 (#194) #440

Workflow file for this run

name: CI
on:
push:
branches-ignore:
- "dependabot/**"
tags:
- "*"
pull_request:
workflow_dispatch:
env:
FORCE_COLOR: 2
NODE: 18
RUBY: "3.2"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}
cache: npm
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY }}
bundler-cache: true
- name: Install npm dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Upload docs
uses: actions/upload-artifact@v3
if: github.repository == 'mdo/github-buttons' && startsWith(github.ref, 'refs/tags/')
with:
name: docs
path: ./_site/
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
needs: test
if: github.repository == 'mdo/github-buttons' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Download docs
uses: actions/download-artifact@v3
with:
name: docs
path: ./_site/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
allow_empty_commit: false
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_branch: gh-pages
publish_dir: ./_site/