Skip to content

Release

Release #172

Workflow file for this run

name: Release
permissions:
id-token: write
contents: write
on:
push:
branches:
- main
paths:
- ".github/workflows/release.yml"
- "awesome/**"
schedule:
- cron: "0 9 15 * *" # every 15th of the month at 9:00 AM UTC
workflow_dispatch:
jobs:
render-data:
name: Render Data
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Setup CI
run: |
make setup-ci
- name: Render awesome data
if: github.event_name == 'push'
run: |
make release ARGS=--without-analytics
- name: Render awesome with analytics data
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
TOKEN_GITHUB_PUBLIC_API: ${{ secrets.TOKEN_GITHUB_PUBLIC_API }}
run: |
make release
- name: Render awesome README.md
run: |
git config --global user.email "${{ secrets.ACTION_EMAIL }}"
git config --global user.name "FabrizioCafolla"
if [ -z "$(git status --porcelain)" ]; then
echo "Nothing to update"
else
git add awesome/**/README.md
git add analytics/*
git commit -m "release(awesome): update awesome data"
git push
fi
- name: Trigger deployment workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.ACTION_WORKFLOWS }}
retries: 3
script: |
const owner = 'italia-opensource';
const repo = 'italiaopensource.com';
const event_type = 'sync-database';
const ref = 'main';
const client_payload = {
"hash": "${{ github.sha }}",
"run_id": "${{ github.run_id }}",
};
github.rest.repos.createDispatchEvent({
owner,
repo,
event_type,
client_payload
});