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.

72 lines
2.1 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
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
  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. - cp ../../output/_combined.json names.json
  31. - zip /code.zip *
  32. - name: website-build
  33. image: node:14.14.0
  34. depends_on: [compile-samples]
  35. environment:
  36. DEBIAN_FRONTEND: noninteractive
  37. commands:
  38. - apt-get update
  39. - apt-get install -y --no-install-recommends build-essential ca-certificates curl git ssh libssl-dev
  40. - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --no-modify-path
  41. - . $HOME/.cargo/env
  42. - npm install
  43. - npm run export
  44. - mkdir __sapper__/export/assets
  45. - cp __sapper__/build/server/assets/*.wasm __sapper__/export/assets/
  46. - name: website-deploy
  47. image: amazon/aws-cli:latest
  48. depends_on:
  49. - website-build
  50. - lambda-build
  51. environment:
  52. AWS_ACCESS_KEY_ID:
  53. from_secret: aws_access_key_id
  54. AWS_SECRET_ACCESS_KEY:
  55. from_secret: aws_secret_access_key
  56. AWS_DEFAULT_REGION:
  57. from_secret: aws_region
  58. S3_WEBUI_BUCKET:
  59. from_secret: s3_webui_bucket
  60. CF_DISTRIBUTION_ID:
  61. from_secret: cf_distribution_id
  62. commands:
  63. - cd __sapper__/export
  64. - aws s3 sync --delete . s3://$S3_WEBUI_BUCKET
  65. - aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths "/*"
  66. - aws lambda update-function-code --function-name namegen_lambda --zip-file fileb://../../code.zip