Merge remote-tracking branch 'origin' into cesium.com #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: prod | |
on: | |
push: | |
branches: | |
- 'cesium.com' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install node 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: npm install | |
run: npm install | |
- name: lint *.js | |
run: npm run eslint | |
- name: lint *.md | |
run: npm run markdownlint | |
- name: format code | |
run: npm run prettier-check | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
PROD: true | |
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: us-east-1 | |
BRANCH: ${{ github.ref_name }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPO: ${{ github.repository }} | |
GITHUB_SHA: ${{ github.sha }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install node 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: npm install | |
run: npm install | |
- name: build website release | |
run: npm run website-release | |
- name: build apps | |
run: npm run build-apps | |
- name: deploy to cesium.com | |
if: ${{ env.AWS_ACCESS_KEY_ID != '' }} | |
run: | | |
unzip Cesium-$(cat package.json | jq -r '.version').zip -d Build/release/ -x "Apps" | |
aws s3 sync Build/release/ s3://cesium-website/cesiumjs/releases/$(cat package.json | jq -r '.version')/ --cache-control "public, max-age=1800" --delete | |
aws s3 sync Build/Documentation/ s3://cesium-website/cesiumjs/ref-doc/ --cache-control "public, max-age=1800" --delete | |
aws s3 sync Build/CesiumViewer/ s3://cesium-website/cesiumjs/cesium-viewer/ --cache-control "public, max-age=1800" --delete | |
aws s3 sync Build/Sandcastle/ s3://cesium-sandcastle-website/ --cache-control "public, max-age=1800" --delete |