Skip to content

Rewritten to acdhOeaw\arche\lib\dissCache\Service #19

Rewritten to acdhOeaw\arche\lib\dissCache\Service

Rewritten to acdhOeaw\arche\lib\dissCache\Service #19

Workflow file for this run

name: test and deploy
on:
workflow_dispatch:
inputs:
deploy:
type: boolean
description: Deploy if not a release
default: false
push: ~
release:
types: [published]
env:
RANCHER_PROJECT: Dissemination services
RANCHER_NAMESPACE: arche-iiifmanifest
jobs:
testAndDeploy:
runs-on: ubuntu-latest
steps:
- uses: acdh-oeaw/arche_cicd_start_action@main
with:
phpExtensions: json,yaml,pdo,pdo_sqlite
prepareRepoConfig: true
- name: build docker image
run: |
mkdir build/docroot && cp -R `ls -1 | grep -v ^build` build/docroot/ && cp build/config/arche/* build/docroot/ && cp .htaccess build/docroot/
docker build --rm -t "acdhch/$RANCHER_NAMESPACE:latest" --build-arg VARIANT=production --label "buildUrl=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" build
- name: test image
run: |
composer require -n zozlak/yaml-merge
vendor/bin/yaml-edit.php --src build/config/arche/config_image.yaml --src '{"dissCacheService": {"repoDb": []}}' config_image.yaml
vendor/bin/yaml-edit.php --src build/config/arche/config_manifest.yaml --src '{"dissCacheService": {"repoDb": []}}' config_manifest.yaml
docker run -d --name "$RANCHER_NAMESPACE" -v `pwd`/config_image.yaml:/var/www/html/config_image.yaml -v `pwd`/config_manifest.yaml:/var/www/html/config_manifest.yaml -p 8080:80 "acdhch/$RANCHER_NAMESPACE:latest"
sleep 1
for mode in image images manifest ; do
# collection
curl -f -i "http://127.0.0.1:8080/?mode=$mode&id=https://arche.acdh.oeaw.ac.at/api/585903"
curl -f -i "http://127.0.0.1:8080/?mode=$mode&id=https://arche.acdh.oeaw.ac.at/api/585903"
# resource
curl -f -i "http://127.0.0.1:8080/?mode=$mode&id=https://arche.acdh.oeaw.ac.at/api/600233"
curl -f -i "http://127.0.0.1:8080/?mode=$mode&id=https://arche.acdh.oeaw.ac.at/api/600233"
done
- uses: acdh-oeaw/arche_cicd_finish_action@main
with:
pushAndRedeploy: ${{ github.event_name == 'release' && github.event.action == 'published' || inputs.deploy }}
dockerhubLogin: ${{ secrets.DOCKER_USERNAME }}
dockehubPassword: ${{ secrets.DOCKER_PASSWORD }}
imageName: $RANCHER_NAMESPACE
rancherProject: $RANCHER_PROJECT
rancherNamespace: $RANCHER_NAMESPACE
rancherToken: ${{ secrets.RANCHERTOKEN }}
coverallsToken: ${{ secrets.coverallsToken }}