generated from astrochun/github-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.81 KB
/
gh-pages-deploy.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
47
48
49
50
51
52
53
54
55
name: Deploy GitHub pages with traffic stats
on:
schedule:
- cron: "0 3 * * *"
jobs:
build-n-publish:
runs-on: ubuntu-latest
env:
BOT_NAME: 'github-actions[bot]'
BOT_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Update repository topics
shell: bash
env:
URL: https://api.github.com/repos/${{ github.repository }}/topics
TOPICS: '{"names":["github","docker","github-pages","traffic","static-site","python3","stats","github-actions","github-stats-pages"]'
AUTH: "Authorization: token ${{ secrets.GH_TOKEN }}"
run: |
curl -X PUT "$URL" -d "$TOPICS" \
-H "Accept: application/vnd.github.mercy-preview+json" -H "$AUTH"
- name: Build GitHub stats pages
uses: astrochun/github-stats-pages@latest
with:
username: ${{ github.repository_owner }}
token: ${{ secrets.GH_TOKEN }}
include-repos: "osprey"
- name: List contents
run: |
ls -ltRh
- name: Upload data to main branch
uses: EndBug/[email protected]
with:
add: 'data'
branch: main
message: "Update data: ${{ steps.date.outputs.date }}"
author_name: ${{ env.BOT_NAME }}
author_email: ${{ env.BOT_EMAIL }}
- name: Upload static files to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./public
keep_files: false
user_name: ${{ env.BOT_NAME }}
user_email: ${{ env.BOT_EMAIL }}
publish_branch: gh-pages
commit_message: "Update static pages: ${{ steps.date.outputs.date }}"