Update build-cdn.yml #3
Workflow file for this run
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: Deploy to k8s | |
on: | |
push: | |
branches: | |
- feat/upload_to_cdn | |
env: | |
ILLA_GOOGLE_MAP_KEY: ${{ secrets.ILLA_GOOGLE_MAP_KEY }} | |
ILLA_MIXPANEL_API_KEY: ${{ secrets.ILLA_MIXPANEL_API_KEY }} | |
ILLA_AMPLITUDE_API_KEY: ${{ secrets.ILLA_AMPLITUDE_API_KEY }} | |
ILLA_MUI_LICENSE: ${{ secrets.ILLA_MUI_LICENSE }} | |
ILLA_SENTRY_AUTH_TOKEN: ${{ secrets.ILLA_SENTRY_AUTH_TOKEN }} | |
DO_CLUSTER: ${{ secrets.DO_CLUSTER }} | |
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} | |
DOCKER_PWD: ${{ secrets.DOCKER_PWD }} | |
jobs: | |
build: | |
name: Build website | |
runs-on: ubuntu-latest | |
environment: | |
name: test-cdn | |
env: | |
ILLA_API_BASE_URL: ${{ vars.ILLA_API_BASE_URL }} | |
ILLA_APP_ENV: ${{ vars.ILLA_APP_ENV }} | |
ILLA_BUILDER_URL: ${{ vars.ILLA_BUILDER_URL }} | |
ILLA_CLOUD_URL: ${{ vars.ILLA_CLOUD_URL }} | |
ILLA_MARKET_URL: ${{ vars.ILLA_MARKET_URL }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.12.1 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.7.0 | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build website | |
run: | | |
echo "Building for $GITHUB_REF_NAME branch,ILLA APP ENV is $ILLA_APP_ENV" | |
pnpm build-cloud | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.DO_SPACES_KEY }} | |
aws-secret-access-key: ${{ secrets.DO_SPACES_SECRET }} | |
aws-region: "sfo3" | |
- name: Upload to DigitalOcean Spaces | |
run: | | |
aws s3 sync ./apps/builder/dist s3://${{ secrets.DO_SPACES_BUCKET }} --endpoint-url https://$AWS_REGION.digitaloceanspaces.com --acl public-read --delete --cache-control | |
"public, max-age=31536000" | |
env: | |
AWS_REGION: "sfo3" # 请确保这与上面匹配 |