diff --git a/.github/workflows/cloud-admin.yml b/.github/workflows/cloud-admin.yml new file mode 100644 index 00000000000..6602795e977 --- /dev/null +++ b/.github/workflows/cloud-admin.yml @@ -0,0 +1,43 @@ +name: Build and Deploy Cloud Admin to Netlify +on: + push: + tags: + - "*" + branches: ["main"] + paths: + - ".github/workflows/cloud-admin.yml" + - "web-admin/**" + - "web-common/**" +env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ fromJSON('["e73ac785-882e-425a-8fc8-5432528bb374","afb26917-7a60-47d9-81dc-c0babbb0d9a9"]')[ startsWith(github.ref, 'refs/tags/v') == 'true' ] }} + DEPLOY_SITE: ${{ fromJSON('["ui.rilldata.io","ui.rilldata.com"]')[ startsWith(github.ref, 'refs/tags/v') == 'true' ] }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up NodeJS + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build Cloud Admin + run: |- + npm install + npm run build -w web-admin + + - name: Deploy cloud-admin to Netlify + uses: nwtgck/actions-netlify@v1.2 + with: + publish-dir: ./web-admin/build + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Cloud-admin ${{ github.ref_name }} deployed to ${{ env.DEPLOY_SITE }}" + production-deploy: true + enable-pull-request-comment: false + enable-commit-comment: true + overwrites-pull-request-comment: true + timeout-minutes: 1