-
-
Notifications
You must be signed in to change notification settings - Fork 76
79 lines (69 loc) · 2.04 KB
/
release.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 = 'italia-opensource-website';
const event_type = 'deployment';
const ref = 'main';
github.rest.repos.createDispatchEvent({
owner,
repo,
event_type
});