name: namegen5 kind: pipeline type: docker steps: - name: download-samples image: docker:git commands: - git clone https://git.aiterp.net/namegen5/samples - name: compile-samples image: rust:1.50.0-slim depends_on: [download-samples] environment: SOURCE_DIR: ../samples DESTINATION_DIR: output/ commands: - cd compiler - mkdir output/ - cargo run --release - name: website-build image: node:14.14.0 depends_on: [compile-samples] environment: DEBIAN_FRONTEND: noninteractive commands: - apt-get update - apt-get install -y --no-install-recommends build-essential ca-certificates curl git ssh libssl-dev - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --no-modify-path - . $HOME/.cargo/env - npm install - npm run export - mkdir __sapper__/export/assets - cp __sapper__/build/server/assets/*.wasm __sapper__/export/assets/ - name: website-deploy image: amazon/aws-cli:latest depends_on: - website-build environment: AWS_ACCESS_KEY_ID: from_secret: aws_access_key_id AWS_SECRET_ACCESS_KEY: from_secret: aws_secret_access_key AWS_DEFAULT_REGION: from_secret: aws_region S3_WEBUI_BUCKET: from_secret: s3_webui_bucket CF_DISTRIBUTION_ID: from_secret: cf_distribution_id commands: - cd __sapper__/export - aws s3 sync --delete . s3://$S3_WEBUI_BUCKET - aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths "/*"