Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage Release #2625

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
21 changes: 19 additions & 2 deletions .github/workflows/cd-beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,24 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Create Stable Release PR
run: gh pr create -B stable -H beta --title 'Stable Release' --body 'Created by Github action'

- name: Check if PR exists
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prs=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--head 'beta' \
--base 'stable' \
--json title \
--jq 'length')
if ((prs > 0)); then
echo "skip=true" >> "$GITHUB_OUTPUT"
fi

- name: Create Stable Release
if: "!steps.check.outputs.skip"
run: gh pr create -B stable -H dev --title 'Stable Release' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119 changes: 119 additions & 0 deletions .github/workflows/cd-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: cd-dev

concurrency:
group: dev
cancel-in-progress: true

on:
# Uncomment to work on CD in development mode.
# pull_request:
# branches: [ master ]
push:
branches:
- dev

jobs:
deploy_dev:
runs-on: ubuntu-latest
env:
ENV: "dev"

steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Auth with Gcloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_DEV_SA_KEY }}
- name: Set up Gcloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: zesty-dev
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "16.5.0"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build:dev
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Deploy to Dev
run: gcloud app deploy app.yaml --quiet --project zesty-dev

failed_deploy_notification_to_slack:
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [deploy_dev]
steps:
- name: Failed Deploy Notification To Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: code-deploy
SLACK_COLOR: "#FF2A08"
SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg
SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy."
SLACK_TITLE: "FAILED: Dev Deployment for manager-ui"
SLACK_USERNAME: Deploy Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

success_deploy_notification_to_slack:
runs-on: ubuntu-latest
if: ${{ success() }}
needs: [deploy_dev]
steps:
- name: Success Deploy Notification To Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: code-deploy
SLACK_COLOR: "#75BF43"
SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg
# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage."
SLACK_TITLE: "SUCCESS: Dev Deployment of manager-ui"
SLACK_USERNAME: Deploy Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.GITHUB_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
target-branch: stage

# create_stage_pr:
# runs-on: ubuntu-latest
# needs: [deploy_dev]
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v2

# - name: Check if PR exists
# id: check
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# prs=$(gh pr list \
# --repo "$GITHUB_REPOSITORY" \
# --head 'dev' \
# --base 'stage' \
# --json title \
# --jq 'length')
# if ((prs > 0)); then
# echo "skip=true" >> "$GITHUB_OUTPUT"
# fi

# - name: Create Stage Release
# if: "!steps.check.outputs.skip"
# run: gh pr create -B stage -H dev --title 'Stage Release' --body 'Created by Github action'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,52 +1,10 @@
name: cd-dev-stage
name: cd-stage

on:
# Uncomment to work on CD in development mode.
# pull_request:
# branches: [ master ]
push:
branches:
- dev
- stage
jobs:
deploy_dev:
runs-on: ubuntu-latest
env:
ENV: "dev"

steps:
# This Clean step simply checks if there's already a workflow running from the last
# commit and cancels it if there is. This helps us save on cloud cost in the long run.
# See https://github.com/rokroskar/workflow-run-cleanup-action for more information.
- name: Clean
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/master'"
- name: Checkout Repo
uses: actions/checkout@v2
- name: Auth with Gcloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_DEV_SA_KEY }}
- name: Set up Gcloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: zesty-dev
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "16.5.0"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build:dev
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Deploy to Dev
run: gcloud app deploy app.yaml --quiet --project zesty-dev

deploy_stage:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -89,7 +47,7 @@ jobs:
failed_deploy_notification_to_slack:
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [deploy_dev, deploy_stage]
needs: [deploy_stage]
steps:
- name: Failed Deploy Notification To Slack
uses: rtCamp/action-slack-notify@v2
Expand All @@ -98,7 +56,7 @@ jobs:
SLACK_COLOR: "#FF2A08"
SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg
SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy."
SLACK_TITLE: "FAILED: Dev/Stage Deployment for manager-ui"
SLACK_TITLE: "FAILED: Stage Deployment for manager-ui"
SLACK_USERNAME: Deploy Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

Expand All @@ -120,7 +78,7 @@ jobs:

create_beta_pr:
runs-on: ubuntu-latest
needs: [deploy_dev, deploy_stage]
needs: [deploy_stage]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand All @@ -132,7 +90,7 @@ jobs:
run: |
prs=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--head 'dev' \
--head 'stage' \
--base 'beta' \
--json title \
--jq 'length')
Expand All @@ -142,6 +100,6 @@ jobs:

- name: Create Beta Release
if: "!steps.check.outputs.skip"
run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action'
run: gh pr create -B beta -H stage --title 'Beta Release' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ export const ItemEditHeaderActions = ({
{itemState === ITEM_STATES.draft ||
itemState === ITEM_STATES.dirty ||
publishAfterSave ||
isFetching ? (
isFetching ||
saving ? (
<ButtonGroup
variant="contained"
color="success"
Expand Down
18 changes: 13 additions & 5 deletions src/apps/media/src/app/components/FileModal/RenameFileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import {
} from "@mui/material";
import { alpha } from "@mui/material/styles";

import { withCursorPosition } from "../../../../../../shell/components/withCursorPosition";

const TextFieldWithCursorPosition = withCursorPosition(TextField);

interface Props {
handleUpdateMutation: (renamedFilename: string) => void;
onClose?: () => void;
Expand Down Expand Up @@ -72,7 +76,7 @@ export const RenameFileModal: FC<Props> = ({
</DialogTitle>
<DialogContent>
<InputLabel>New File Name</InputLabel>
<TextField
<TextFieldWithCursorPosition
sx={{
mt: 1,
width: "100%",
Expand All @@ -82,12 +86,16 @@ export const RenameFileModal: FC<Props> = ({
},
}}
autoFocus
onFocus={(evt) => evt.target.select()}
onFocus={(evt: React.FocusEvent<HTMLInputElement>) =>
evt.target.select()
}
value={renamedFilename}
onChange={(evt) => {
setRenamedFilename(evt.target.value);
onChange={(evt: React.ChangeEvent<HTMLInputElement>) => {
setRenamedFilename(evt.target.value.replace(" ", "-"));
}}
onKeyPress={(event) => event.key === "Enter" && handleUpdate()}
onKeyPress={(event: React.KeyboardEvent<HTMLDivElement>) =>
event.key === "Enter" && handleUpdate()
}
InputProps={{
disableUnderline: true,
endAdornment: (
Expand Down
10 changes: 8 additions & 2 deletions src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import {

import { alpha } from "@mui/material/styles";

import { withCursorPosition } from "../../../../../../shell/components/withCursorPosition";

const TextFieldWithCursorPosition = withCursorPosition(TextField);

interface Props {
filename: string;
onFilenameChange?: (value: string) => void;
Expand Down Expand Up @@ -45,13 +49,15 @@ export const ThumbnailContent: FC<Props> = ({
{onFilenameChange ? (
<Box>
<Box>
<TextField
<TextFieldWithCursorPosition
value={filename}
size="small"
variant="outlined"
fullWidth
disabled={!isEditable}
onChange={(e) => onFilenameChange(e.target.value)}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
onFilenameChange(e.target.value.replace(" ", "-"))
}
sx={{
"& .MuiInputBase-root.MuiOutlinedInput-root": {
borderRadius: 0,
Expand Down
Loading