Deploy #1578
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |