get_vespa_velutina_management #20
Workflow file for this run
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
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 6 * * 1' | |
name: get_vespa_velutina_management | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: test_secrets | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Check if secrets exist | |
run: | | |
if [ $(echo "${{secrets.iasset_username}}" | wc -c) -lt 2 ]; then | |
echo "The secret 'iasset_user' has not been set." | |
echo "Please go to 'Settings > Secrets > Actions' to create it." | |
exit 1 | |
fi | |
if [ $(echo "${{secrets.iasset_password}}" | wc -c) -lt 2 ]; then | |
echo "The secret 'iasset_password' has not been set." | |
echo "Please go to 'Settings > Secrets > Actions' to create it." | |
exit 1 | |
fi | |
if [ $(echo "${{secrets.service}}" | wc -c) -lt 2 ]; then | |
echo "The secret 'service' has not been set." | |
echo "Please go to 'Settings > Secrets > Actions' to create it." | |
exit 1 | |
fi | |
if [ $(echo "${{secrets.GBIF_USER}}" | wc -c) -lt 2 ]; then | |
echo "The secret 'iasset_user' has not been set." | |
echo "Please go to 'Settings > Secrets > Actions' to create it." | |
exit 1 | |
fi | |
if [ $(echo "${{secrets.GBIF_EMAIL}}" | wc -c) -lt 2 ]; then | |
echo "The secret 'iasset_user' has not been set." | |
echo "Please go to 'Settings > Secrets > Actions' to create it." | |
exit 1 | |
fi | |
if [ $(echo "${{secrets.GBIF_PWD}}" | wc -c) -lt 2 ]; then | |
echo "The secret 'iasset_user' has not been set." | |
echo "Please go to 'Settings > Secrets > Actions' to create it." | |
exit 1 | |
fi | |
get_data_from_gbif: | |
needs: test | |
runs-on: ${{ matrix.config.os }} | |
name: get_data_from_gbif | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: ubuntu-latest, r: 'release'} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: ${{ matrix.config.rspm }} | |
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | |
gbif_user: ${{ secrets.GBIF_USER }} | |
email: ${{ secrets.GBIF_EMAIL }} | |
gbif_pwd: ${{ secrets.GBIF_PWD }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.AUTOMATISATION }} | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
- name: Setup pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install linux libraries | |
run: | | |
sudo apt install libsodium-dev | |
sudo apt-get install libcurl4-openssl-dev | |
sudo apt-get install libgdal-dev libproj-dev | |
sudo apt install libudunits2-dev | |
- name: Install R packages | |
run: | | |
source("src/Vespa velutina management/install_packages_vespa_velutina_gbif.R") | |
shell: Rscript {0} | |
- name: Get data from gbif | |
run: | | |
source("src/Vespa velutina management/run_get_data_from_gbif.R") | |
shell: Rscript {0} | |
- name: Commit and push changes | |
uses: devops-infra/action-commit-push@master | |
with: | |
github_token: ${{ secrets.AUTOMATISATION }} | |
commit_prefix: "[AUTO]" | |
commit_message: "get data from gbif" | |
force: true | |
target_branch: automatic-vespa-velutina-data | |
get_data_from_iasset: | |
needs: test | |
runs-on: ${{ matrix.config.os }} | |
name: get_data_from_iasset | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: ubuntu-latest, r: 'release'} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: ${{ matrix.config.rspm }} | |
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | |
iasset_username: ${{ secrets.iasset_username }} | |
iasset_password: ${{ secrets.iasset_password }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.AUTOMATISATION }} | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
- name: Setup pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install linux libraries | |
run: | | |
sudo apt install libsodium-dev | |
sudo apt-get install libcurl4-openssl-dev | |
sudo apt-get install libgdal-dev libproj-dev | |
sudo apt install libudunits2-dev | |
sudo apt install --yes libharfbuzz-dev libfribidi-dev | |
R --no-save -e 'install.packages("devtools")' | |
R --no-save -e 'devtools::install_github("inbo/iassetR@43-get-keyring-to-work-with-github-actions")' | |
- name: Install R packages | |
run: | | |
source("src/Vespa velutina management/install_packages_vespa_velutina_iasset.R") | |
shell: Rscript {0} | |
- name: Get data from iAsset | |
run: | | |
source("src/Vespa velutina management/run_get_data_from_iAsset.R") | |
shell: Rscript {0} | |
- name: Commit and push changes | |
uses: devops-infra/action-commit-push@master | |
with: | |
github_token: ${{ secrets.AUTOMATISATION }} | |
commit_prefix: "[AUTO]" | |
commit_message: "get data from iasset" | |
force: true | |
target_branch: automatic-vespa-velutina-data | |
update_inputs: | |
needs: [get_data_from_gbif, get_data_from_iasset] | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: ubuntu-latest, r: 'release'} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: ${{ matrix.config.rspm }} | |
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.AUTOMATISATION }} | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
- name: Setup pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install linux libraries | |
run: | | |
sudo apt install libsodium-dev | |
sudo apt-get install libcurl4-openssl-dev | |
sudo apt-get install libgdal-dev libproj-dev | |
sudo apt install libudunits2-dev | |
- name: Install R packages | |
run: | | |
source("src/Vespa velutina management/install_packages_vespa_velutina_general.R") | |
shell: Rscript {0} | |
- name: Get data from gbif | |
run: | | |
source("src/Vespa velutina management/run_update_inputs.R") | |
shell: Rscript {0} | |
- name: Commit and push changes | |
uses: devops-infra/action-commit-push@master | |
with: | |
github_token: ${{ secrets.AUTOMATISATION }} | |
commit_prefix: "[AUTO]" | |
commit_message: "update inputs" | |
force: true | |
target_branch: automatic-vespa-velutina-data | |
- name: Get branch name | |
run: | | |
git branch --show-current | |
- name: Create pull request | |
uses: devops-infra/action-pull-request@v0.4.2 | |
with: | |
github_token: ${{ secrets.AUTOMATISATION }} | |
target_branch: uat | |
title: "[AUTO] get vespa velutina management data" | |
template: .github/PR_vespa_velutina_management.md | |
reviewer: SanderDevisscher, jrhilae, soriadelva | |
label: automated workflow, | |
get_diff: false |