95 lines
2.9 KiB
YAML
95 lines
2.9 KiB
YAML
name: Test, Build, Deploy
|
|
on: [push]
|
|
|
|
jobs:
|
|
Test-Build-Deploy:
|
|
name: Test, Build, and Deploy
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
CLOUDFLARE_PROJECT_NAME: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
|
|
COMMIT_SHA: ${{ gitea.sha }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
|
|
with:
|
|
node-version-file: .node-version
|
|
|
|
- name: Install Wrangler
|
|
run: npm install -g wrangler
|
|
|
|
- name: Install Dependencies
|
|
run: npm ci --include=dev
|
|
|
|
- name: Check Formatting
|
|
run: npm run check-format
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Set Version as Var
|
|
run: |
|
|
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects/$CLOUDFLARE_PROJECT_NAME \
|
|
-X PATCH \
|
|
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"deployment_configs": {
|
|
"production": {
|
|
"env_vars": {
|
|
"COMMIT_SHA": {
|
|
"type": "plain_text",
|
|
"value": "'"$COMMIT_SHA"'"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}'
|
|
|
|
- name: Deploy
|
|
run: wrangler pages deploy public --project-name $CLOUDFLARE_PROJECT_NAME
|
|
|
|
Sentry-Release:
|
|
name: Create Sentry Release
|
|
runs-on: ubuntu-latest
|
|
needs: Test-Build-Deploy
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
|
|
- name: Install Sentry SDK
|
|
run: |
|
|
if ! [ -x "$(command -v sentry-cli)" ]; then
|
|
curl -sL https://sentry.io/get-cli/ | bash
|
|
fi
|
|
|
|
- name: Create Remix Release
|
|
run: |
|
|
VERSION=$(sentry-cli releases propose-version)
|
|
sentry-cli releases new $VERSION
|
|
sentry-cli releases set-commits --auto $VERSION --ignore-missing
|
|
sentry-cli releases finalize $VERSION
|
|
|
|
env:
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
|
SENTRY_PROJECT: ${{ vars.SENTRY_REMIX_PROJECT }}
|
|
|
|
- name: Create API Release
|
|
run: |
|
|
VERSION=$(sentry-cli releases propose-version)
|
|
sentry-cli releases new $VERSION
|
|
sentry-cli releases set-commits --auto $VERSION --ignore-missing
|
|
sentry-cli releases finalize $VERSION
|
|
|
|
env:
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
|
SENTRY_PROJECT: ${{ vars.SENTRY_API_PROJECT }}
|