--- image: $CI_REGISTRY/immerda/container-images/yarn-gen:latest stages: - build - deploy build: tags: - container script: - git clone https://code.immerda.ch/immerda/apps/wkd-frontend.git - cd wkd-frontend - cp -a ../{static,index.html,icon.png} public/ - rm -f public/favicon.ico - yarn -v - yarn install - yarn run build - curl -o dist/ipick.js https://code.immerda.ch/immerda/content/ipick/-/raw/master/ipick.js - tar cfz site.tar.gz dist - mv site.tar.gz ../ artifacts: paths: - site.tar.gz expire_in: 1 day stage: build deploy: tags: - container script: # Start SSH agent - eval $(ssh-agent -s) # Add the SSH key stored in the $DEPLOY_KEY variable to the agent store # It is the base64 encoded private key - echo "${DEPLOY_KEY}" | base64 -d | ssh-add - > /dev/null - mkdir -p --mode=0700 ~/.ssh - printf "${DEPLOY_HOST} ssh-ed25519 ${DEPLOY_HOST_ED_KEY} " > ~/.ssh/known_hosts - tar fxv site.tar.gz # lftp needs a "dummy" password, even if key-based authentication is used. - lftp -e "mirror -eRv -x ^.well-known/ dist www; quit;" -u $DEPLOY_USER,dummy sftp://$DEPLOY_HOST stage: deploy only: # This job relies on secret env vars, which are only available in our repo. - master variables: GIT_STRATEGY: none