pages:
  cache: {}
  image: alpine:latest
  tags:
    - public-docker
  stage: deploy
  script:
  - mkdir public
  - apk --update add tar zip git sed
  - tar czf public/pandas-tutorial-tasks.tar.gz --transform 's,^,pandas-tutorial-tasks/,' Introduction-to-Pandas--tasks.ipynb Introduction-to-Pandas--solution.ipynb data-lost.json data-nest.csv
  - cp public/pandas-tutorial-tasks.tar.gz .
  - tar xf pandas-tutorial-tasks.tar.gz
  - zip -9 -r public/pandas-tutorial-tasks.zip Introduction-to-Pandas--tasks.ipynb Introduction-to-Pandas--solution.ipynb data-lost.json data-nest.csv
  - cp Introduction-to-Pandas--tasks.ipynb Introduction-to-Pandas--solution.ipynb public/
  - cp Introduction-to-Pandas--slides.ipynb public/
  - cp Introduction-to-Pandas--slides.pdf public/
  - cp static-slides-bundle.tar.gz public/pandas-tutorial-slides-bundle.tar.gz
  - cp static-slides-bundle.zip public/pandas-tutorial-slides-bundle.zip
  - export BASE_REPO_HASH=$(git rev-parse --short HEAD)
  - git checkout -f pages
  - git reset --hard origin/pages
  - sed -i "s/PAGES_HASH/"`git rev-parse --short HEAD`"/" index.html
  - sed -i "s/REPO_HASH/"`echo $BASE_REPO_HASH`"/" index.html
  - cp index.html public/
  artifacts:
    paths:
    - public
