mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-17 13:21:44 +01:00
Set app version on build
Fix bug with removing "about" in profile editor
This commit is contained in:
parent
bb855a2f8f
commit
fc8c758e82
5
.changeset/ninety-goats-visit.md
Normal file
5
.changeset/ninety-goats-visit.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"nostrudel": patch
|
||||
---
|
||||
|
||||
Fix bug with removing "about" in profile editor
|
21
.github/workflows/deploy-next.yml
vendored
21
.github/workflows/deploy-next.yml
vendored
@ -11,9 +11,6 @@ concurrency:
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
@ -29,24 +26,16 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Set build env
|
||||
run: |
|
||||
echo "VITE_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
echo "VITE_APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
- name: Redirect 404 to Index for SPA
|
||||
run: cp dist/index.html dist/404.html
|
||||
|
||||
# - name: Deploy
|
||||
# uses: reggionick/s3-deploy@v4
|
||||
# with:
|
||||
# folder: dist
|
||||
# bucket: "${{ secrets.S3_BUCKET }}"
|
||||
# bucket-region: us-east-1
|
||||
# dist-id: "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}"
|
||||
# invalidation: /
|
||||
# delete-removed: true
|
||||
# no-cache: true
|
||||
# private: true
|
||||
# files-to-include: "{.*/**,**}"
|
||||
|
||||
- name: Deploy nsite
|
||||
run: npx -y nsite-cli upload dist --verbose --purge --privatekey ${{ secrets.NSITE_KEY }}
|
||||
|
7
.github/workflows/docker-image.yml
vendored
7
.github/workflows/docker-image.yml
vendored
@ -50,8 +50,8 @@ jobs:
|
||||
|
||||
- name: Set build env
|
||||
run: |
|
||||
echo "VITE_COMMIT_HASH=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
|
||||
echo "VITE_APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV
|
||||
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
echo "APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
@ -61,3 +61,6 @@ jobs:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
COMMIT_HASH=$COMMIT_HASH
|
||||
APP_VERSION=$APP_VERSION
|
||||
|
2
.github/workflows/pages.yml
vendored
2
.github/workflows/pages.yml
vendored
@ -45,7 +45,7 @@ jobs:
|
||||
|
||||
- name: Set build env
|
||||
run: |
|
||||
echo "VITE_COMMIT_HASH=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
|
||||
echo "VITE_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
echo "VITE_APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build
|
||||
|
@ -16,8 +16,10 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l
|
||||
FROM base AS build
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
|
||||
ENV VITE_COMMIT_HASH=""
|
||||
ENV VITE_APP_VERSION="Custom"
|
||||
ARG COMMIT_HASH=""
|
||||
ARG APP_VERSION=""
|
||||
ENV VITE_COMMIT_HASH="$COMMIT_HASH"
|
||||
ENV VITE_APP_VERSION="$APP_VERSION"
|
||||
|
||||
COPY tsconfig.json .
|
||||
COPY index.html .
|
||||
|
@ -9,7 +9,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "vite serve",
|
||||
"dev": "VITE_APP_VERSION=production vite serve",
|
||||
"dev": "VITE_APP_VERSION=dev vite serve",
|
||||
"build": "tsc --project tsconfig.json && vite build",
|
||||
"format": "prettier --ignore-path .prettierignore -w .",
|
||||
"analyze": "npx vite-bundle-visualizer -o ./stats.html",
|
||||
|
@ -11,7 +11,7 @@ export default function VersionButton({ ...props }: Omit<ButtonProps, "children"
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant="outline"
|
||||
variant="link"
|
||||
size="sm"
|
||||
rightIcon={copied ? <CheckIcon /> : <CopyToClipboardIcon />}
|
||||
onClick={() => {
|
||||
@ -23,7 +23,7 @@ export default function VersionButton({ ...props }: Omit<ButtonProps, "children"
|
||||
}}
|
||||
{...props}
|
||||
>
|
||||
Version: {version}
|
||||
{version}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
@ -224,10 +224,10 @@ export const ProfileEditView = () => {
|
||||
picture: data.picture,
|
||||
banner: data.banner,
|
||||
};
|
||||
if (data.displayName) newMetadata.displayName = newMetadata.display_name = data.displayName;
|
||||
if (data.about) newMetadata.about = data.about;
|
||||
if (data.website) newMetadata.website = data.website;
|
||||
if (data.nip05) newMetadata.nip05 = data.nip05;
|
||||
if (data.displayName !== undefined) newMetadata.displayName = newMetadata.display_name = data.displayName;
|
||||
if (data.about !== undefined) newMetadata.about = data.about;
|
||||
if (data.website !== undefined) newMetadata.website = data.website;
|
||||
if (data.nip05 !== undefined) newMetadata.nip05 = data.nip05;
|
||||
|
||||
if (data.lightningAddress) {
|
||||
if (isLNURL(data.lightningAddress)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user