Skip to content

Commit

Permalink
Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Feb 29, 2024
0 parents commit 399df6c
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

strategy:
matrix:
config:
- churches
- paintings

steps:
- uses: actions/checkout@v4

- name: Set variables
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "docker_image=ghcr.io/netwerk-digitaal-erfgoed/heritageflix-${{ matrix.config }}" >> $GITHUB_OUTPUT
echo "deployment=heritageflix-${{ matrix.config }}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}

- name: Build and push image to registry
uses: docker/build-push-action@v5
with:
context: ${{ matrix.config }}
push: true
tags: |
${{ steps.vars.outputs.docker_image }}:${{ steps.vars.outputs.sha_short }}
${{ steps.vars.outputs.docker_image }}:latest
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Store DigitalOcean credentials
run: doctl kubernetes cluster kubeconfig save nde

- name: Update deployment
run: |
kubectl set image deployment/${{ steps.vars.outputs.deployment }} app=${{ steps.vars.outputs.docker_image }}:${{ steps.vars.outputs.sha_short }}
- name: Verify deployment
run: kubectl rollout status deployment/${{ steps.vars.outputs.deployment }} --timeout=120s
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ghcr.io/netwerk-digitaal-erfgoed/heritageflix

COPY . /app/config
9 changes: 9 additions & 0 deletions churches/banner-rijksmuseum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions churches/branding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Churchflix",
"intro": {
"title": "Churchflix",
"description": "Een kijkje in de wereld van de kerk in Nederland"
}
}
8 changes: 8 additions & 0 deletions churches/logo-rijksmuseum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions churches/queries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"baseUrl": "https://api.data.netwerkdigitaalerfgoed.nl/datasets/heritageflix/churches-v1/services/churches-v1/sparql",
"categoryQuery": "PREFIX gn: <http://www.geonames.org/ontology#> PREFIX schema: <https://schema.org/> SELECT ?id ?name (COUNT(?heritageObject) AS ?numberOfHeritageObjects) WHERE { ?heritageObject a schema:CreativeWork ; schema:contentLocation ?contentLocation . ?contentLocation gn:parentADM1 ?id . ?id gn:name ?name . } ORDER BY ?name",
"itemsQuery": "PREFIX gn: <http://www.geonames.org/ontology#> PREFIX schema: <https://schema.org/> SELECT * WHERE { { SELECT ?heritageObject ?identifier ?description ?dateCreated ?imageURI ?imageLicenseURI ?imageLicenseName ?provinceURI ?provinceName ?publisherURI ?publisherName ?publisherHomepage (GROUP_CONCAT(?creator; SEPARATOR='; ') AS ?creators) (GROUP_CONCAT(?creatorName; SEPARATOR='; ') AS ?creatorNames) (GROUP_CONCAT(?contentLocationURI; SEPARATOR='; ') AS ?contentLocationURIs) (GROUP_CONCAT(?contentLocationName; SEPARATOR='; ') AS ?contentLocationNames) WHERE { BIND(<_CATEGORYID_> AS ?provinceURI) ?heritageObject a schema:CreativeWork ; schema:identifier ?identifier ; schema:description ?description ; schema:dateCreated ?dateCreated ; schema:creator ?creator ; schema:contentLocation ?contentLocationURI ; schema:publisher ?publisher ; schema:image ?image . ?image schema:contentUrl ?imageURI ; schema:license ?imageLicenseURI . ?imageLicenseURI schema:name ?imageLicenseName . ?creator schema:name ?creatorName . ?contentLocationURI gn:name ?contentLocationName ; gn:parentADM1 ?provinceURI . ?provinceURI gn:name ?provinceName . ?publisher schema:name ?publisherName ; schema:mainEntityOfPage ?publisherHomepage . OPTIONAL { ?heritageObject schema:mainEntityOfPage ?publisherURI } } ORDER BY ?contentLocationName } } LIMIT _LIMIT_ OFFSET _OFFSET_",
"disableLinks": ["creators"]
}
9 changes: 9 additions & 0 deletions paintings/banner-rijksmuseum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions paintings/branding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "Heritageflix"
}
8 changes: 8 additions & 0 deletions paintings/logo-rijksmuseum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions paintings/queries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"baseUrl": "https://api.data.netwerkdigitaalerfgoed.nl/datasets/heritageflix/artworks-v2/services/artworks-v2/sparql",
"categoryQuery": "PREFIX schema: <https://schema.org/> SELECT DISTINCT (COUNT(?heritageObject) AS ?numberOfHeritageObjects) ?id ?name ?description ?startDate ?endDate WHERE { ?heritageObject a schema:VisualArtwork ; schema:temporalCoverage ?id . ?id a schema:DefinedTerm ; schema:name ?name ; schema:startDate ?startDate . OPTIONAL { ?id schema:endDate ?endDate . ?id schema:description ?description } } ORDER BY ?startDate LIMIT _LIMIT_",
"itemsQuery": "PREFIX schema: <https://schema.org/> SELECT * WHERE { { SELECT ?heritageObject ?name ?description ?dateCreated ?imageURI ?imageLicenseURI ?imageLicenseName ?publisherURI ?publisherName ?publisherHomepage (GROUP_CONCAT(?creator; SEPARATOR='; ') AS ?creators) (GROUP_CONCAT(?creatorName; SEPARATOR='; ') AS ?creatorNames) WHERE { BIND(<_CATEGORYID_> AS ?temporalCoverage) ?heritageObject a schema:VisualArtwork ; schema:name ?name ; schema:description ?description ; schema:dateCreated ?dateCreated ; schema:creator ?creator ; schema:temporalCoverage ?temporalCoverage ; schema:image ?image ; schema:publisher ?publisher . ?image schema:contentUrl ?imageURI ; schema:license ?imageLicenseURI . ?imageLicenseURI schema:name ?imageLicenseName . ?creator <http://schema.org/name> ?creatorName . ?publisher schema:name ?publisherName ; schema:mainEntityOfPage ?publisherHomepage . OPTIONAL { ?heritageObject schema:mainEntityOfPage ?publisherURI } } ORDER BY ?dateCreated } } LIMIT _LIMIT_ OFFSET _OFFSET_"
}

0 comments on commit 399df6c

Please sign in to comment.