The namegen5 website.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.2 KiB

4 years ago
2 years ago
4 years ago
4 years ago
4 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
2 years ago
4 years ago
4 years ago
2 years ago
  1. name: namegen5
  2. kind: pipeline
  3. type: docker
  4. steps:
  5. - name: download-samples
  6. image: docker:git
  7. commands:
  8. - git clone https://git.aiterp.net/namegen5/samples
  9. - name: compile-samples
  10. image: rust:1.63.0-slim
  11. depends_on: [download-samples]
  12. environment:
  13. SOURCE_DIR: ../samples
  14. DESTINATION_DIR: output/
  15. commands:
  16. - cd compiler
  17. - mkdir output/
  18. - cargo run --release
  19. - name: lambda-build
  20. image: rust:1.63.0-slim
  21. depends_on: [compile-samples]
  22. commands:
  23. - cd ./src/rust/namegen-lambda
  24. - apt-get update
  25. - apt-get install -y python3-pip zip
  26. - python3 -m pip install --upgrade pip
  27. - python3 -m pip install cargo-lambda
  28. - cargo lambda build --release
  29. - cd ./target/lambda/namegen_lambda
  30. - ls -lh ../../../../../../
  31. - cp ../../../../../../compiler/output/_combined.json names.json
  32. - zip ../../../../../../code.zip *
  33. - name: website-build
  34. image: node:14.14.0
  35. depends_on: [compile-samples]
  36. environment:
  37. DEBIAN_FRONTEND: noninteractive
  38. commands:
  39. - apt-get update
  40. - apt-get install -y --no-install-recommends build-essential ca-certificates curl git ssh libssl-dev
  41. - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --no-modify-path
  42. - . $HOME/.cargo/env
  43. - npm install
  44. - npm run export
  45. - mkdir __sapper__/export/assets
  46. - cp __sapper__/build/server/assets/*.wasm __sapper__/export/assets/
  47. - name: website-deploy
  48. image: amazon/aws-cli:latest
  49. depends_on:
  50. - website-build
  51. - lambda-build
  52. environment:
  53. AWS_ACCESS_KEY_ID:
  54. from_secret: aws_access_key_id
  55. AWS_SECRET_ACCESS_KEY:
  56. from_secret: aws_secret_access_key
  57. AWS_DEFAULT_REGION:
  58. from_secret: aws_region
  59. S3_WEBUI_BUCKET:
  60. from_secret: s3_webui_bucket
  61. CF_DISTRIBUTION_ID:
  62. from_secret: cf_distribution_id
  63. commands:
  64. - cd __sapper__/export
  65. - aws s3 sync --delete . s3://$S3_WEBUI_BUCKET
  66. - aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths "/*"
  67. - cd ../../
  68. - aws lambda update-function-code --function-name namegen_lambda --zip-file fileb://$(pwd)/code.zip