Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Staging env variable WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaKulkarni committed Oct 26, 2023
1 parent d03a4e0 commit 79e2535
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches:
- 'master'
- 'main'
- 'staging'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Staging
on:
push:
branches:
- 'staging'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
publish:
runs-on: ubuntu-20.04
name: Publish
environment: staging
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare repository
run: git fetch --unshallow --tags

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

- name: Install dependencies
run: |
yarn -v
yarn install --immutable
- name: Build
run: export DEFAULT_BRANCH=staging;yarn run build

- name: Create Release
run: yarn auto shipit -v
5 changes: 4 additions & 1 deletion core/create-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ export async function createApp(config: CreateMagicAppConfig) {
};

const templateFlags: any = await parseFlags(mapTemplateToFlags(config.template as string), config?.data);
const repoUrl = new URL(`${DEFAULT_CREATE_MAGIC_APP_REPO}/tree/${config.branch}`, GITHUB_BASE_URL);
const repoUrl = new URL(
`${DEFAULT_CREATE_MAGIC_APP_REPO}/tree/${process.env.DEFAULT_BRANCH ?? config.branch}`,
GITHUB_BASE_URL,
);
const repoInfo = await getRepoInfo(repoUrl, getRelativeTemplatePath(config.template as string));
if (repoInfo) {
const templatePath = getAbsoluteTemplatePath(config.template as string);
Expand Down

0 comments on commit 79e2535

Please sign in to comment.