Merge pull request #135 from technologiestiftung/staging #1409
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: harvester (test mode) | |
permissions: | |
contents: write | |
packages: write | |
on: | |
push: | |
branches: | |
- master | |
- staging | |
pull_request: | |
branches: | |
- master | |
- staging | |
workflow_dispatch: | |
env: | |
PG_SERVER: localhost | |
PG_PORT: "54322" | |
PG_USER: postgres | |
PG_PASS: postgres | |
PG_DB: postgres | |
SUPABASE_URL: http://localhost:54321 | |
SUPABASE_BUCKET_NAME: data_assets | |
OUTPUT: "True" | |
MAPBOXUSERNAME: "123" | |
MAPBOXTOKEN: "456" | |
MAPBOXTILESET: "xyz" | |
MAPBOXLAYERNAME: "abc" | |
LOGGING: INFO | |
SKIP_MAPBOX: "True" | |
WEATHER_HARVEST_LAT: "52.520008" | |
WEATHER_HARVEST_LNG: "13.404954" | |
jobs: | |
test-harvest: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
steps: | |
- name: Get the source | |
uses: actions/checkout@v4 | |
- name: Use Node.js from .nvmrc | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Get the source for the api staging | |
uses: actions/checkout@v4 | |
if: github.event.pull_request.base.ref == 'staging' || github.ref == 'refs/heads/staging' | |
with: | |
repository: technologiestiftung/giessdenkiez-de-postgres-api | |
path: api | |
ref: staging | |
- name: Get the source for the api master | |
uses: actions/checkout@v4 | |
if: github.event.pull_request.base.ref == 'master' || github.ref == 'refs/heads/master' | |
with: | |
repository: technologiestiftung/giessdenkiez-de-postgres-api | |
path: api | |
- uses: supabase/setup-cli@v1 | |
with: | |
version: 1.136.3 | |
- name: build the harvester | |
run: cd harvester && docker build --tag technologiestiftung/giessdenkiez-de-dwd-harvester:test . | |
- name: Start the api | |
id: api-start | |
run: cd api && supabase start | grep -w "service_role key" | cut -d ":" -f 2 | xargs | tr -d '\n' | awk '{print "service_role_key="$1}' >> "$GITHUB_OUTPUT" && cd .. | |
- name: run the harvester | |
run: docker run --env PG_SERVER='0.0.0.0' --env WEATHER_HARVEST_LAT --env WEATHER_HARVEST_LNG --env SKIP_MAPBOX --env PG_DB --env PG_PORT --env PG_USER --env PG_PASS --env SUPABASE_URL --env SUPABASE_SERVICE_ROLE_KEY='${{ steps.api-start.outputs.service_role_key }}' --env LIMIT_DAYS='30' --env SURROUNDING_SHAPE_FILE='/app/assets/buffer.shp' --env SUPABASE_BUCKET_NAME --env MAPBOXTOKEN --env MAPBOXUSERNAME --env MAPBOXTILESET --env MAPBOXLAYERNAME --env LOGGING --env OUTPUT --network host technologiestiftung/giessdenkiez-de-dwd-harvester:test | |
- name: stop the api | |
run: cd api && supabase stop && cd .. | |
release: | |
name: semantic-release | |
needs: [test-harvest] | |
runs-on: ubuntu-latest | |
outputs: | |
new-release-published: ${{ steps.semantic-release.outputs.new_release_published }} | |
new-release-version: ${{ steps.semantic-release.outputs.new_release_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- run: npm ci | |
- id: semantic-release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |