Merge pull request #650 from dice-group/develop #352
This file contains hidden or 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: Deploy | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| check-bib: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: hub.cs.upb.de | |
| username: ${{ vars.DOCKER_REGISTRY_USERNAME }} | |
| password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| - name: Check file | |
| run: docker run --name=biber -v ./data:/data -e BIB_FILE=/data/bib/dice.bib hub.cs.upb.de/ag-ngonga/biber-image | |
| # Check according to https://timheuer.com/blog/manually-force-a-failure-in-github-action-step/ | |
| - name: Collect test result | |
| id: collect | |
| shell: pwsh | |
| run: $result = docker wait biber | |
| - name: Check test result | |
| if: ${{ steps.collect.outputs.result > 0 }} | |
| uses: actions/github-script@v3 | |
| with: | |
| script: | | |
| core.setFailed('Biber detected an error in the bib file') | |
| upload-bib: | |
| needs: check-bib | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v2 | |
| with: | |
| java-version: '11' | |
| distribution: 'adopt' | |
| - name: Download uploader | |
| run: curl --retry 4 -L -o "bibupload_18.jar" "https://files.dice-research.org/website/bib-uploader/bibupload_18.jar" | |
| - name: Upload | |
| shell: bash | |
| env: | |
| BIBSONOMY_SECRET: ${{ secrets.BIBSONOMY_API_TOKEN }} | |
| run: java -jar bibupload_18.jar dice-research "$BIBSONOMY_SECRET" "http://www.bibsonomy.org/api" data/bib/dice.bib | |
| deploy: | |
| needs: upload-bib | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| with: | |
| ref: master | |
| - name: Use Node.js 14 | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 14 | |
| - name: configure DNS server | |
| run: | | |
| sudo mkdir /usr/lib/systemd/resolved.conf.d | |
| echo "[Resolve]" > resolved.conf | |
| echo "DNS=8.8.8.8" >> resolved.conf | |
| sudo mv resolved.conf /usr/lib/systemd/resolved.conf.d/resolved.conf | |
| sudo systemctl daemon-reload | |
| sudo systemctl restart systemd-networkd | |
| sudo systemctl restart systemd-resolved | |
| - name: install and lint | |
| working-directory: ./scripts | |
| run: | | |
| npm install | |
| npm run lint | |
| - name: update papers | |
| working-directory: ./scripts | |
| run: | | |
| rm ../data/**/_Example.ttl | |
| npm run papers | |
| - name: build | |
| working-directory: ./scripts | |
| run: npm run build | |
| - name: prepare deploy | |
| working-directory: ./scripts | |
| run: | | |
| cp exoframe.json public/ | |
| cp Dockerfile public/ | |
| - name: deploy | |
| working-directory: ./scripts/public | |
| run: npx exoframe -u -vvv -e https://dice-website.cs.upb.de -t $EXO_TOKEN_DICE | |
| env: | |
| EXO_TOKEN_DICE: ${{ secrets.EXO_TOKEN_DICE }} | |
| syncBranches: | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: merge master to develop | |
| run: | | |
| git config --global user.email "bot@dice-research.org" | |
| git config --global user.name "DICE Bot" | |
| git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY | |
| git checkout develop | |
| git merge origin/master | |
| git push origin develop | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| uploadData: | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| with: | |
| ref: master | |
| - name: Use Node.js 14 | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 14 | |
| - name: configure DNS server | |
| run: | | |
| sudo mkdir /usr/lib/systemd/resolved.conf.d | |
| echo "[Resolve]" > resolved.conf | |
| echo "DNS=8.8.8.8" >> resolved.conf | |
| sudo mv resolved.conf /usr/lib/systemd/resolved.conf.d/resolved.conf | |
| sudo systemctl daemon-reload | |
| sudo systemctl restart systemd-networkd | |
| sudo systemctl restart systemd-resolved | |
| - name: install and lint | |
| working-directory: ./scripts | |
| run: | | |
| npm install | |
| npm run lint | |
| - name: update papers | |
| working-directory: ./scripts | |
| run: | | |
| rm ../data/**/_Example.ttl | |
| npm run papers | |
| - name: collect RDF data | |
| run: cat `find . -name "*.ttl" | grep -v "_Example.ttl"` > data.ttl | |
| - name: upload to FTP | |
| uses: tomasbkk/action-ftp-upload@v1.2 | |
| with: | |
| user: ${{ secrets.FTP_USER }} | |
| password: ${{ secrets.FTP_PASSWORD }} | |
| host: ${{ secrets.FTP_HOST }} | |
| src: data.ttl | |
| dest: public/website/data/data.ttl | |
| secure: true | |
| rejectUnauthorized: false |