Repository navigation
90 lines (75 loc) · 2.38 KB
/
Copy pathci.yml
File metadata and controls
90 lines (75 loc) · 2.38 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches-ignore:
- "dependabot/**"
tags:
- "*"
pull_request:
workflow_dispatch:
permissions: {}
env:
FORCE_COLOR: 2
NODE: 24
RUBY: "3.4"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ env.NODE }}
# no cache on tags since that build gets deployed
cache: ${{ !startsWith(github.ref, 'refs/tags/') && 'npm' || '' }} # zizmor: ignore[cache-poisoning]
package-manager-cache: false
- name: Set up Ruby
uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
with:
ruby-version: ${{ env.RUBY }}
bundler-cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Install gems
if: startsWith(github.ref, 'refs/tags/')
run: bundle install
- name: Install npm dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Upload docs
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
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/')
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download docs
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: docs
path: ./_site/
- name: Deploy
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
allow_empty_commit: false
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_branch: gh-pages
publish_dir: ./_site/