Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-mn-yral committed Feb 13, 2024
1 parent 1f5fe77 commit aff4919
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 38 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/webclient-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Set-up env
uses: ./.github/workflows/webclient-setup
- run: npm run wc:build:static:prod
Expand All @@ -39,15 +37,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Set-up env
uses: ./.github/workflows/webclient-setup
- run: npm run wc:build:prod
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy production build
run: flyctl deploy --config ./wc.fly.toml --dockerfile ./wc.Dockerfile
run: flyctl deploy --config ./wc.prod.fly.toml --dockerfile ./wc.Dockerfile
env:
FLY_API_TOKEN: ${{ secrets.FLYIO_KIT_DEPLOY_GH_ACTION }}
43 changes: 11 additions & 32 deletions .github/workflows/webclient-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,27 @@ jobs:
- name: Run svelte-check
run: npm run wc:check

web-client-deploy-cloudflare-staging:
web-client-deploy-fly-staging:
needs: ["svelte-check"]
environment:
name: pr-${{ github.event.number }}
url: ${{ steps.deploy.outputs.url }}
runs-on: ubuntu-latest
outputs:
previewUrl: ${{ steps.preview-url.outputs.url }}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"

- name: Set-up env
uses: ./.github/workflows/webclient-setup
- run: npm run wc:build:static:prod

- name: Deploy preview build
- run: npm run wc:build:prod

- name: Deploy staging build
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_WORKERS_DEPLOY_API_TOKEN }}
workingDirectory: "packages/web-client/"
command: pages deploy build --branch=${{ github.head_ref }} --project-name=hot-or-not-web-client --commit-dirty=true
uses: superfly/[email protected]
env:
CLOUDFLARE_ACCOUNT_ID: "a209c523d2d9646cc56227dbe6ce3ede"

- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Webclient preview build: ${{ steps.deploy.outputs.previewUrl }}'
})
- name: Send deployment URL to Google Chat
if: github.actor != 'dependabot[bot]'
uses: fjogeleit/[email protected]
FLY_API_TOKEN: ${{ secrets.FLYIO_KIT_DEPLOY_GH_ACTION }}
with:
url: "https://chat.googleapis.com/v1/spaces/AAAAAfsrp8U/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=_QvV-c8ZdTVTzGZxXW_PdR_o-0HI8VhO3I9dMAp6zls%3D"
method: "POST"
customHeaders: '{"Content-Type": "application/json"}'
data: '{"text": "web-client staging build for PR: \"${{ github.event.pull_request.title }}\" deployed at: \n ${{ steps.deploy.outputs.previewUrl }}"}'
config: "wc.staging.fly.toml"

tests-lighthouse-reports:
needs: ["svelte-check"]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"wc:build:prod": "PRODUCTION=true npm run build --w @hnn/web-client",
"wc:build:static": "npm run build:static --w @hnn/web-client",
"wc:build:static:prod": "PRODUCTION=true npm run build:static --w @hnn/web-client",
"wc:deploy": "fly deploy --config ./wc.fly.toml --dockerfile ./wc.Dockerfile --debug",
"wc:deploy": "fly deploy --config ./wc.prod.fly.toml --dockerfile ./wc.Dockerfile --debug",
"wc:preview": "npm run preview --w @hnn/web-client",
"wc:preview:static": "npm run preview:static --w @hnn/web-client",
"wc:dev": "npm run dev --w @hnn/web-client",
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions wc.staging.fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# fly.toml app configuration file generated for hot-or-not-kit on 2024-01-04T16:13:20+05:30
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "hot-or-not-kit-staging"
primary_region = "bos"

[build]

[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 1024

0 comments on commit aff4919

Please sign in to comment.