-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaction.yml
46 lines (42 loc) · 1.96 KB
/
action.yml
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
name: "Monkeytype Readme"
description: "A GitHub Action to generate Monkeytype Readme SVGs, let you share Monkeytype story with the world."
branding:
icon: "bookmark"
color: "yellow"
inputs:
username:
description: "Your Monkeytype username"
required: true
themes:
description: "Themes to generate SVGs for"
required: true
target-branch:
description: "Branch to deploy Monkeytype Readme SVGs"
required: true
github-token:
description: "GitHub token use to deploy github pages"
required: true
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Download SVG
shell: bash
run: |
mkdir monkeytype-readme-svg
curl -o monkeytype-readme-svg/${{ inputs.username }}-monkeytype-readme.svg https://monkeytype-readme.zeabur.app/generate-svg/${{ inputs.username }}/${{ inputs.themes }}
curl -o monkeytype-readme-svg/${{ inputs.username }}-monkeytype-readme-lb.svg https://monkeytype-readme.zeabur.app/generate-svg/${{ inputs.username }}/${{ inputs.themes }}?lb=true
curl -o monkeytype-readme-svg/${{ inputs.username }}-monkeytype-readme-pb.svg https://monkeytype-readme.zeabur.app/generate-svg/${{ inputs.username }}/${{ inputs.themes }}?pb=true
curl -o monkeytype-readme-svg/${{ inputs.username }}-monkeytype-readme-lb-pb.svg https://monkeytype-readme.zeabur.app/generate-svg/${{ inputs.username }}/${{ inputs.themes }}?lbpb=true
- name: push monkeytype-readme.svg to the monkeytype-readme branch
uses: crazy-max/ghaction-github-pages@v4.0.0
with:
target_branch: ${{ inputs.target-branch }}
build_dir: monkeytype-readme-svg
env:
GITHUB_TOKEN: ${{ inputs.github-token }}