mirror of https://github.com/pyodide/pyodide.git
CI Add deployment setup for pyodide-cdn2.iodide.io (#666)
This commit is contained in:
parent
f2c4d63c89
commit
9f9a6c3965
|
@ -143,6 +143,11 @@ jobs:
|
|||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Install requirements
|
||||
command: |
|
||||
apk add --no-cache --update python3
|
||||
python3 -m pip install awscli
|
||||
- run:
|
||||
name: Deploy Github Releases
|
||||
command: |
|
||||
|
@ -151,23 +156,30 @@ jobs:
|
|||
popd
|
||||
ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" -delete "${CIRCLE_TAG}" ./pyodide-build-${CIRCLE_TAG}.tar.bz2
|
||||
|
||||
deploy-netlify:
|
||||
- run:
|
||||
name: Deploy to pyodide-cdn2.iodide.io
|
||||
command: |
|
||||
aws s3 sync --delete build/ "s3://pyodide-cdn2.iodide.io/v${CIRCLE_TAG}/full/" --cache-control max-age=30758400 # 1 year
|
||||
# update 301 redirect for the /latest/* route.
|
||||
aws s3api put-bucket-website --cli-input-json file://.circleci/s3-website-config.json
|
||||
|
||||
deploy-s3:
|
||||
docker:
|
||||
- image: circleci/node:latest
|
||||
- image: circleci/python:3.7.7
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Install netlify-cli
|
||||
name: Install requirements
|
||||
command: |
|
||||
sudo npm install netlify-cli -g
|
||||
sudo apt-get install -y groff
|
||||
python3 -m pip install awscli
|
||||
- run:
|
||||
name: Deploy to netlify
|
||||
name: Deploy to pyodide-cdn2.iodide.io
|
||||
command: |
|
||||
cp src/_headers build
|
||||
netlify deploy --prod --dir=build -m "Deployed from CircleCI"
|
||||
aws s3 sync --delete build/ "s3://pyodide-cdn2.iodide.io/dev/full/" --cache-control max-age=3600 # 1 hour
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
@ -203,12 +215,10 @@ workflows:
|
|||
ignore: /.*/
|
||||
tags:
|
||||
only: /^\d+\.\d+\.\d+$/
|
||||
- deploy-netlify:
|
||||
- deploy-s3:
|
||||
requires:
|
||||
- test-firefox
|
||||
- test-python
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^\d+\.\d+\.\d+$/
|
||||
only: master
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"Bucket": "pyodide-cdn2.iodide.io",
|
||||
"WebsiteConfiguration": {
|
||||
"IndexDocument": {
|
||||
"Suffix": "index.html"
|
||||
},
|
||||
"RoutingRules": [
|
||||
{
|
||||
"Condition": {
|
||||
"KeyPrefixEquals": "latest/"
|
||||
},
|
||||
"Redirect": {
|
||||
"ReplaceKeyPrefixWith": "v0.14.3/"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue