Run publisher #309
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: Run publisher | |
on: | |
schedule: | |
- cron: '0 3 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
# cf. https://docs.github.com/en/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions | |
runs-on: ubuntu-latest | |
steps: | |
## Free Disk Sapce: based on https://github.com/marketplace/actions/free-disk-space-ubuntu | |
#- name: Free Disk Space (Ubuntu) | |
# uses: jlumbroso/free-disk-space@main | |
# with: | |
# # this might remove tools that are actually needed, | |
# # if set to "true" but frees about 6 GB | |
# tool-cache: false | |
# # all of these default to true, but feel free to set to | |
# # "false" if necessary for your workflow | |
# android: true | |
# dotnet: true | |
# haskell: true | |
# large-packages: true | |
# docker-images: true | |
# swap-storage: true | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Increase git buffer size | |
run: | | |
git config --global http.postBuffer 1048576000 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Install rclone | |
run: | | |
curl https://rclone.org/install.sh | sudo bash | |
- name: install gdal | |
run: | | |
sudo add-apt-repository ppa:ubuntugis/ppa | |
sudo apt-get update | |
sudo apt-get install gdal-bin | |
sudo apt-get install libgdal-dev | |
#- name: Create rclone config file | |
# run: echo "${{ secrets.RCLONE_CONFIG }}" > rclone.conf | |
- name: Run Python script PUBLISH | |
run: | | |
python satromo_publish.py integration_config.py | |
env: # Set the secrets as env var | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
RCONF_SECRET: ${{ secrets.RCONF_SECRET }} | |
- name: Run Python script PUBLISH STAC | |
run: | | |
python satromo_publish_stac.py | |
env: # Set the secrets as env var | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
RCONF_SECRET: ${{ secrets.RCONF_SECRET }} | |
- name: Push tools files to repo | |
uses: github-actions-x/commit@v2.9 | |
with: | |
push-branch: 'main' | |
commit-message: 'Tools files done' | |
force-add: 'true' | |
files: tools/ | |
name: autoupdate | |
- name: Push processing files to repo | |
uses: github-actions-x/commit@v2.9 | |
with: | |
push-branch: 'main' | |
commit-message: 'Processing files done' | |
force-add: 'true' | |
files: processing/ | |
name: autoupdate | |
- name: Invalidate CloudFront of satromoint | |
uses: chetan/invalidate-cloudfront-action@v2 | |
env: | |
DISTRIBUTION: ${{ secrets.DISTRIBUTION }} | |
PATHS: "/stac-collection/*" | |
AWS_REGION: "eu-central-2" | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |