Skip to content

Commit e1f530f

Browse files
authored
Update README.md
1 parent 18ee98a commit e1f530f

File tree

1 file changed

+5
-101
lines changed

1 file changed

+5
-101
lines changed

README.md

Lines changed: 5 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This GitHub Action creates a GitHub contribution calendar on a 3D profile image.
1010

11-
## How to use (GitHub Actions)
11+
## How to use (GitHub Actions) - Basic
1212

1313
This action generate your github profile 3d contribute calendar and make a commit to your repo.
1414
You can also trigger action by yourself after add this action.
@@ -130,6 +130,10 @@ e.g.
130130
![](./profile-3d-contrib/profile-green-animate.svg)
131131
```
132132

133+
## How to use (GitHub Actions) - Advanced examples
134+
135+
#### [More info in EXAMPLES.md](./EXAMPLES.md)
136+
133137
## How to use (local)
134138

135139
Set the `GITHUB_TOKEN` environment variable to the value of "personal access token".
@@ -151,106 +155,6 @@ npm run build
151155
node . USER_NAME
152156
```
153157

154-
## Advanced example: automatic day/night switching + keeping output in other branch
155-
156-
This alternative workflow generates two files, `day.svg` and `night.svg`, and pushes it to `output-3d-contrib` branch, keeping the main repo 'clean' from build artifacts.
157-
158-
### step 1. Create special repository ([see above](#step-1-create-special-repository))
159-
### step 2. Create `conf/github-profile-3d-contrib.json` file in your <username> repo:
160-
```json:conf/github-profile-3d-contrib.json
161-
[
162-
{
163-
"type": "normal",
164-
"fileName": "day.svg",
165-
"backgroundColor": "#ffffff",
166-
"foregroundColor": "#00000f",
167-
"strongColor": "#111133",
168-
"weakColor": "gray",
169-
"radarColor": "#47a042",
170-
"growingAnimation": true,
171-
"contribColors": [
172-
"#efefef",
173-
"#d8e887",
174-
"#8cc569",
175-
"#47a042",
176-
"#1d6a23"
177-
]
178-
},
179-
{
180-
"type": "rainbow",
181-
"fileName": "night.svg",
182-
"backgroundColor": "#00000f",
183-
"foregroundColor": "#eeeeff",
184-
"strongColor": "rgb(255,200,55)",
185-
"weakColor": "#aaaaaa",
186-
"radarColor": "rgb(255,200,55)",
187-
"growingAnimation": true,
188-
"saturation": "50%",
189-
"contribLightness": [
190-
"20%",
191-
"30%",
192-
"35%",
193-
"40%",
194-
"50%"
195-
],
196-
"duration": "10s",
197-
"hueRatio": -7
198-
}
199-
]
200-
```
201-
202-
### step 3. Create `.github/workflows/profile-3d-contrib.yml` workflow file in your <username> repo:
203-
```yaml:.github/workflows/profile-3d-contrib.yml
204-
name: generate 3d chart for profile contributions
205-
206-
on:
207-
# run automatically every 24 hours
208-
schedule:
209-
- cron: "0 */24 * * *"
210-
211-
# allows to manually run the job at any time
212-
workflow_dispatch:
213-
214-
# run on every push on the main branch
215-
# don't forget to change if you're using 'master' branch
216-
push:
217-
branches:
218-
- main
219-
220-
jobs:
221-
build:
222-
runs-on: ubuntu-latest
223-
name: generate-github-profile-3d-contrib
224-
steps:
225-
- uses: actions/checkout@v3
226-
- uses: yoshi389111/github-profile-3d-contrib@0.7.1
227-
env:
228-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229-
USERNAME: ${{ github.repository_owner }}
230-
SETTING_JSON: conf/github-profile-3d-contrib.json
231-
232-
# push the content of <build_dir> to a branch
233-
# the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page
234-
- name: push SVGs to the output-3d branch
235-
uses: crazy-max/ghaction-github-pages@v3.1.0
236-
with:
237-
target_branch: output-3d-contrib
238-
build_dir: profile-3d-contrib
239-
env:
240-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
241-
```
242-
243-
### step 4. Edit `README.md` in your <username> repo, adding the following code:
244-
Do not forget to replace `<github_user>` and `<repository>` with your GitHub username.
245-
```html
246-
<p align="center" >
247-
<picture>
248-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/<github_user>/<repository>/output-3d-contrib/night.svg" />
249-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/<github_user>/<repository>/output-3d-contrib/day.svg" />
250-
<img alt="github profile contributions chart" src="https://raw.githubusercontent.com/<github_user>/<repository>/output-3d-contrib/day.svg" />
251-
</picture>
252-
</p>
253-
```
254158

255159
## Licence
256160

0 commit comments

Comments
 (0)