Skip to content

Ingest Maxar open data #5

Ingest Maxar open data

Ingest Maxar open data #5

name: Ingest Maxar open data
on:
workflow_dispatch:
jobs:
ingest:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Configure kubectl
run: |
gcloud components install gke-gcloud-auth-plugin
gcloud config set project ${{ secrets.PROJECT_ID }}
gcloud config set compute/zone ${{ secrets.COMPUTE_ZONE }}
gcloud container clusters get-credentials ${{ secrets.CLUSTER_NAME }}
- name: Get the latest commit SHA
id: sha
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
- name: Update version in job.yaml
run: |
sed -i 's/{{VERSION}}/${{ steps.sha.outputs.short_sha }}/g' ingest/job.yaml
- name: Trigger data ingestion
run: |
kubectl -n ifrc-eoapi-risk delete --ignore-not-found=true job eoapi-ingest-datasets
kubectl -n ifrc-eoapi-risk apply -f ingest/job.yaml
echo "Job started; check the logs by running this command: 'kubectl -n ifrc-eoapi-risk logs -f jobs/eoapi-ingest-datasets'"