chore: Publish preview release + deploy staging every 3 hours (#7341)

* wip

* Wrap up

* Update .github/workflows/trigger-staging-deployment.yml

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>

* enable schedule

---------

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
This commit is contained in:
Oli Juhl
2024-05-16 12:36:30 +02:00
committed by GitHub
parent 845eda4643
commit 2e42e053d4
3 changed files with 85 additions and 7 deletions

View File

@@ -0,0 +1,59 @@
---
"babel-preset-medusa-package": patch
"create-medusa-app": patch
"@medusajs/medusa-cli": patch
"medusa-dev-cli": patch
"@medusajs/medusa-oas-cli": patch
"@medusajs/oas-github-ci": patch
"@medusajs/openapi-typescript-codegen": patch
"@medusajs/core-flows": patch
"medusa-test-utils": patch
"@medusajs/modules-sdk": patch
"@medusajs/orchestration": patch
"@medusajs/types": patch
"@medusajs/utils": patch
"@medusajs/workflows-sdk": patch
"@medusajs/icons": patch
"@medusajs/toolbox": patch
"@medusajs/ui": patch
"@medusajs/ui-preset": patch
"@medusajs/medusa": patch
"medusa-core-utils": patch
"medusa-interfaces": patch
"medusa-telemetry": patch
"@medusajs/api-key": patch
"@medusajs/auth": patch
"@medusajs/cache-inmemory": patch
"@medusajs/cache-redis": patch
"@medusajs/cart": patch
"@medusajs/currency": patch
"@medusajs/customer": patch
"@medusajs/event-bus-local": patch
"@medusajs/event-bus-redis": patch
"@medusajs/file": patch
"@medusajs/fulfillment": patch
"@medusajs/inventory-next": patch
"@medusajs/link-modules": patch
"@medusajs/notification": patch
"@medusajs/order": patch
"@medusajs/payment": patch
"@medusajs/pricing": patch
"@medusajs/product": patch
"@medusajs/promotion": patch
"@medusajs/file-local-next": patch
"@medusajs/file-s3": patch
"@medusajs/fulfillment-manual": patch
"@medusajs/notification-local": patch
"@medusajs/notification-sendgrid": patch
"@medusajs/payment-stripe": patch
"@medusajs/region": patch
"@medusajs/sales-channel": patch
"@medusajs/stock-location-next": patch
"@medusajs/store": patch
"@medusajs/tax": patch
"@medusajs/user": patch
"@medusajs/workflow-engine-inmemory": patch
"@medusajs/workflow-engine-redis": patch
---
chore: Preview release changeset

View File

@@ -19,13 +19,14 @@ on:
- "docs/**"
- "www/**"
- ".github/**"
schedule:
- cron: "0 */3 * * *"
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Trigger Release
name: Trigger Preview Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
@@ -50,16 +51,16 @@ jobs:
- name: Install Dependencies
run: yarn
- name: Build all packages
run: yarn build
- name: Version packages
run: yarn changeset version --snapshot ${{ github.event.inputs.version }}
run: yarn changeset version --snapshot ${{ github.event.inputs.version || 'preview' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: yarn install --no-immutable
- name: Build all packages
run: yarn build
- name: Publish packages under next tag
run: yarn changeset publish --no-git-tags --snapshot --tag ${{ github.event.inputs.version }}
run: yarn changeset publish --no-git-tags --snapshot --tag ${{ github.event.inputs.version || 'preview' }}

View File

@@ -0,0 +1,18 @@
name: Trigger Staging Deployment
on:
workflow_run:
workflows: [Trigger Release and Publish]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.STAGING_DEPLOY_ACCESS_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/medusajs/staging/actions/workflows/deploy.yml/dispatches \
-d '{"ref":"main"}'