Skip to content

.github/workflows/traffic.yml #222

.github/workflows/traffic.yml

.github/workflows/traffic.yml #222

Workflow file for this run

on:
schedule:
# runs each day at 23:55
- cron: "55 23 * * *"
workflow_dispatch:
jobs:
# This workflow contains a single job called "traffic"
traffic:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
ref: "traffic"
# Calculates traffic and clones and stores in CSV file, pointed at the rap-community-of-practice repo
- name: GitHub traffic
uses: sangonzal/repository-traffic-action@v.0.1.6
env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}
REPOSITORY_NAME: "NHSDigital/rap-community-of-practice"
# Install dependencies
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install dash pandas plotly
# Create the 'images' directory
- name: Create Images Directory
run: mkdir -p images
working-directory: ${{ github.workspace }}
# Run my python script to generate html graphs
- name: Generate Traffic Graphs
run: python app.py
working-directory: ${{ github.workspace }}
# Commit the generated graphs to the ./images/ folder
- name: Commit image changes
uses: EndBug/add-and-commit@v4
with:
author_name: Jennifer Struthers
message: "update traffic graphs"
add: "./images/*"
ref: "traffic" # commits to branch "traffic"
# Commits files to repository
- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
author_name: Jennifer Struthers
message: "GitHub traffic"
add: "./traffic/*"
ref: "traffic" # commits to branch "traffic"