Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/push-cloudflare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,22 @@ jobs:
cargo install worker-build
fi

- name: Replace D1_DATABASE_ID in wrangler.toml
run: sed -i "s/\${D1_DATABASE_ID}/${{ secrets.D1_DATABASE_ID }}/g" wrangler.toml
# - name: Replace D1_DATABASE_ID in wrangler.toml
# run: sed -i "s/\${D1_DATABASE_ID}/${{ secrets.D1_DATABASE_ID }}/g" wrangler.toml

- uses: cloudflare/wrangler-action@v3
id: cf
env:
D1_DATABASE_ID: ${{ secrets.D1_DATABASE_ID }}
# env:
# D1_DATABASE_ID: ${{ secrets.D1_DATABASE_ID }}
with:
preCommands: |
sed -i "s/\${D1_DATABASE_ID}/$(npx wrangler d1 create --location apac warden-worker | grep -oE '\w{8}-\w{4}-\w{4}-\w{4}-\w{12}')/g" wrangler.toml
npx wrangler d1 execute warden-worker -y --remote --file sql/schema.sql
openssl rand -base64 48 | tr -d '\n' | npx wrangler secret put JWT_SECRET
openssl rand -base64 48 | tr -d '\n' | npx wrangler secret put JWT_REFRESH_SECRET
secrets: |
ALLOWED_EMAILS
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
env:
ALLOWED_EMAILS: ${{ secrets.ALLOWED_EMAILS }}