initial commit #5
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 | |
on: | |
push: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
PROJECT: vcportal | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Dependencies | |
run: pdm install && pdm add git+https://github.com/luotianyi-dev/deploykit.git | |
- name: Build | |
run: | | |
pdm run portal-build \ | |
--assets-cdn-url ${{ secrets.S3_ENDPOINT }}/${{ secrets.S3_BUCKET }}/assets \ | |
--css-cdn-url ${{ secrets.S3_ENDPOINT }}/${{ secrets.S3_BUCKET }}/css \ | |
build --clean --with-assets --with-css --with-manifest | |
- name: Upload to DeployKit | |
run: | | |
pdm run deployctl deploy upload \ | |
--commit ${{ github.sha }} --switch \ | |
-f dist public \ | |
-f server.conf server.conf | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
- name: Upload to S3 | |
run: | | |
pdm run deployctl s3 \ | |
--bucket ${{ secrets.S3_BUCKET }} \ | |
--prefix web/host/vc-portal/ \ | |
-f assets -f css | |
env: | |
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} | |
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} | |
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} | |
working-directory: ./dist |