Skip to content

Analyse data and generate report #539

Analyse data and generate report

Analyse data and generate report #539

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Analyse data and generate report
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 6 * * *'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
STATS_ZIP_PW: ${{ secrets.STATS_ZIP_PW }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install
run: yarn
- name: generate prisma
run: yarn prisma generate
- uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_KEY_CONTAINER_REGISTRY }}'
- uses: google-github-actions/setup-gcloud@v1
- name: Load previous changes.json
run: |
wget -nv https://serlo.github.io/data-pipeline-interactive-exercises/changes.7z
7z x changes.7z
- name: Load previous solved, titles
run: |
wget -nv https://serlo.github.io/data-pipeline-interactive-exercises/solved.7z
7z x solved.7z -p$STATS_ZIP_PW -o./solved
wget -nv https://serlo.github.io/data-pipeline-interactive-exercises/titles.json
- name: Load visits
run: |
mkdir raw
wget -nv https://serlo.github.io/visits-dashboard/rawcache.7z
7z x -p$STATS_ZIP_PW rawcache.7z -o./raw
- name: Run script
run: yarn start
- name: Compress changes.json
run: |
7z a ./_output/changes.7z changes.json
- name: Compress solved, titles
run: |
7z a ./_output/solved.7z -p$STATS_ZIP_PW ./solved/*
mv titles.json ./_output/titles.json
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: '_output/'
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2