-
Notifications
You must be signed in to change notification settings - Fork 265
76 lines (63 loc) · 1.92 KB
/
ci.yml
File metadata and controls
76 lines (63 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CI
on:
push:
branches-ignore:
- "dependabot/**"
tags:
- "*"
pull_request:
workflow_dispatch:
env:
FORCE_COLOR: 2
NODE: 24
RUBY: "3.4"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE }}
cache: npm
- name: Set up Ruby
uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Download docs
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: docs
path: ./_site/
- name: Deploy
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
allow_empty_commit: false
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_branch: gh-pages
publish_dir: ./_site/