Publish pipeline improvement #8
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: Publish the new Tektonic RDF to GraphDB/Public | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
publish_gps: | |
runs-on: ubuntu-latest | |
if: "github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'" | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Upload file via PUT to graphdb-gps | |
env: | |
FILE_PATH: ./tektonik.rdf # percorso del file che vuoi caricare | |
PUT_URL: https://dev-graphdbgps.swissgeol.ch/publish/tektonik_swisstopo_public_core?context=https://lexic.swissgeol.ch/TectonicUnits/ | |
TOKEN: ${{ secrets.LEXIC_CONTROLLED_VOCABULARIES_GRAPHDB_GPS_TOKEN }} | |
run: | | |
response=$(curl -w "%{http_code}" -X PUT -T $FILE_PATH -H "Authorization: Bearer $TOKEN" $PUT_URL -o response.txt) | |
if [[ "$response" -ge 200 && "$response" -lt 300 ]]; then | |
echo "Upload successful: HTTP $response" | |
else | |
echo "Upload failed: HTTP $response" | |
exit 1 | |
fi | |