Skip to content

Commit

Permalink
chore: update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
MuYunyun committed Oct 26, 2020
1 parent c7da8ca commit ced8e09
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# see https://github.com/yi-Xu-0100/traffic-to-badge/blob/main/.github/dependabot.yml
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
# Maintain dependencies for GitHub Actions
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
13 changes: 13 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Welcome your first issue here, thanks'
pr-message: 'Welcome your first pr here, thanks'
58 changes: 58 additions & 0 deletions .github/workflows/traffic2badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: traffic2badge
on:
push:
branches:
- master
schedule:
- cron: '1 0 * * *' #UTC

jobs:
run:
name: Make GitHub Traffic to Badge
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/[email protected]

- name: Get Commit Message
id: message
uses: actions/[email protected]
env:
FULL_COMMIT_MESSAGE: '${{ github.event.head_commit.message }}'
with:
result-encoding: string
script: |
var message = `${process.env.FULL_COMMIT_MESSAGE}`;
core.info(message);
if (message != '') return message;
var time = new Date(Date.now()).toISOString();
core.info(time);
return `Get traffic data at ${time}`;
- name: Set Traffic
id: traffic
uses: yi-Xu-0100/[email protected]
with:
my_token: ${{ secrets.TRAFFIC_TOKEN }}
#(default) static_list: ${{ github.repository }}
#(default) traffic_branch: traffic
#(default) views_color: brightgreen
#(default) clones_color: brightgreen
#(default) logo: github

- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: ${{ steps.traffic.outputs.traffic_branch }}
publish_dir: ${{ steps.traffic.outputs.traffic_path }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
full_commit_message: ${{ steps.message.outputs.result }}

- name: Show Traffic Data
run: |
echo ${{ steps.traffic.outputs.traffic_branch }}
echo ${{ steps.traffic.outputs.traffic_path }}
cd ${{ steps.traffic.outputs.traffic_path }}
ls -a
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Build Status](https://travis-ci.org/MuYunyun/reactSPA.svg?branch=master) ![LICENSE MIT](https://img.shields.io/npm/l/express.svg)
![GitHub views](https://raw.githubusercontent.com/MuYunyun/reactSPA/traffic/traffic-reactSPA/views.svg) ![Build Status](https://travis-ci.org/MuYunyun/reactSPA.svg?branch=master) ![LICENSE MIT](https://img.shields.io/npm/l/express.svg)

该项目是对 React 技术栈以及前端工程化的相关实践。

Expand Down

0 comments on commit ced8e09

Please sign in to comment.