-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.83 KB
/
deploy.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
name: Deploy
on:
workflow_dispatch:
schedule:
- cron: "11 2 * * *"
workflow_run:
workflows: ["CI"]
branches: [main]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
cache-dependency-path: '**/requirements*.txt'
- run: pip install -r requirements.txt
- working-directory: extension_explorer
run: pybabel compile -f -d locale
- name: Build
env:
# For the ocdsextensionregistry package to use the GitHub API to get the organization name.
OCDS_GITHUB_ACCESS_TOKEN: ${{ secrets.OCDS_GITHUB_ACCESS_TOKEN }}
shell: bash
run: |
git clone https://github.com/open-contracting/ocds-extensions-translations.git
ocdsextensionregistry generate-data-file --locale-dir ocds-extensions-translations/locale > extension_explorer/data/extensions.json
python freeze.py
echo "/*
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://use.fontawesome.com; img-src 'self' data: https:; font-src 'self' https://use.fontawesome.com https://use.typekit.net; object-src 'none'; worker-src 'none'; frame-ancestors 'none'
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload" > extension_explorer/build/_headers
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: extension_explorer/build
cname: extensions.open-contracting.org
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'