diff --git a/.github/workflows/pages-deployment.yaml b/.github/workflows/pages-deployment.yaml new file mode 100644 index 0000000..0557d44 --- /dev/null +++ b/.github/workflows/pages-deployment.yaml @@ -0,0 +1,25 @@ + +on: [push] +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Deploy to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Test + run: npm test + - name: Build + run: npm install && npm run ci + - name: Publish + uses: cloudflare/pages-action@1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: YOUR_PROJECT_NAME # e.g. 'my-project' + # directory: YOUR_DIRECTORY_OF_STATIC_ASSETS # e.g. 'dist' + directory: dist/cloudflare + gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index d983863..499bb5d 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "scripts": { "ng": "ng", "start": "npm run build && wrangler pages dev dist/cloudflare --compatibility-date=2024-04-05 --experimental-local", + "ci": "ng build", "build": "ng build && npm run process", "watch": "ng build --watch --configuration development", "test": "ng test", @@ -44,4 +45,4 @@ "typescript": "~5.3.2", "wrangler": "^0.0.0-9a46e03f" } -} \ No newline at end of file +}