Prod Release to CDN #82
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 Release to CDN | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
if: ${{github.repository == 'gtech-world/carbon3-home' && github.ref == 'refs/heads/prod'}} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
- name: Setup Node v16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: v16.16.0 | |
cache: "pnpm" | |
- name: Run install | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm export | |
- name: Install coscmd | |
run: | | |
sudo pip install coscmd | |
sudo pip install tccli | |
- name: Config coscmd | |
env: | |
SECRET_ID: ${{ secrets.CDN_SECRET_ID }} | |
SECRET_KEY: ${{ secrets.CDN_SECRET_KEY }} | |
BUCKET: ${{ secrets.CDN_BUCKET }} | |
REGION: ${{ secrets.CDN_REGION }} | |
run: | | |
coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION | |
tccli configure set secretId $SECRET_ID | |
tccli configure set secretKey $SECRET_KEY | |
tccli configure set region $REGION | |
- name: Uplaod to CDN | |
run: | | |
coscmd upload -rs --delete -f ./out/ / | |
tccli cdn PurgePathCache --cli-unfold-argument --Paths https://aicp.gtech.world/ --FlushType flush |