version: 2.1
orbs:
  slack: circleci/slack@3.4.2
  gh-pages: sugarshin/gh-pages@0.0.6
workflows:
  version: 2
  build:
    jobs:
      - compile_docs:
          filters:
            branches:
              only: dev

jobs:
  compile_docs:
    docker:
      - image: ldbc/docs

    steps:
      - checkout
      - run: |
          make texfot compile_query_cards workloads
          mkdir dist/
          # deploy CircleCI configuration provide 'filters' instructions (and prevent failed build on gh-pages)
          cp -r .circleci dist/
          cp *.pdf dist/
          cp standalone-query-cards/*.pdf dist/
          cp figures/schema-comfortable.pdf dist/schema.pdf
          cp figures/schema-comfortable.png dist/schema.png
          cp figures/example-graph-with-refreshes.pdf dist/example-graph-with-refreshes.pdf
          cp figures/example-graph-without-refreshes.pdf dist/example-graph-without-refreshes.pdf
          cp deployment/readme-to-deploy.md dist/README.md
      - gh-pages/deploy:
          ssh-fingerprints: '9a:14:6d:5a:d6:43:73:dd:fb:d8:a1:bf:6b:1b:db:18'
      - slack/status

version: 2.1
orbs:
  slack: circleci/slack@3.4.2
  gh-pages: sugarshin/gh-pages@0.0.6
workflows:
  version: 2
  build:
    jobs:
      - compile_docs:
          filters:
            branches:
              only: dev

jobs:
  compile_docs:
    docker:
      - image: ldbc/docs

    steps:
      - checkout
      - run: |
          sed -i "s/-SNAPSHOT/-SNAPSHOT (`git rev-parse --short HEAD`)/" ldbc.cls
          make texfot compile_query_cards workloads
          mkdir dist/
          # deploy CircleCI configuration provide 'filters' instructions (and prevent failed build on gh-pages)
          cp -r .circleci dist/
          cp *.pdf dist/
          cp standalone-query-cards/*.pdf dist/
          cp figures/schema-comfortable.pdf dist/schema.pdf
          cp figures/schema-comfortable.png dist/schema.png
          cp figures/example-graph-with-refreshes.pdf dist/example-graph-with-refreshes.pdf
          cp figures/example-graph-without-refreshes.pdf dist/example-graph-without-refreshes.pdf
          cp deployment/readme-to-deploy.md dist/README.md
      - gh-pages/deploy:
          ssh-fingerprints: '9a:14:6d:5a:d6:43:73:dd:fb:d8:a1:bf:6b:1b:db:18'
      - slack/status

Include commit hash in PDF generated by the CI job
Include commit hash in PDF generated by the CI job
