first commit
Some checks are pending
Docker image / build-and-push-image (push) Waiting to run

This commit is contained in:
Your Name 2024-09-17 18:11:55 -06:00
parent 307c15a1da
commit 60f0ce5680
11 changed files with 268 additions and 0 deletions

8
.changeset/README.md Normal file
View File

@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

11
.changeset/config.json Normal file
View File

@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}

9
.dockerignore Normal file
View File

@ -0,0 +1,9 @@
node_modules
dist
.github
.vscode
.changeset
scripts
screenshots
relay
server/node_modules

46
.github/workflows/deploy-next.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: Deploy Next Version
on:
push:
branches:
- next
concurrency:
group: "pages"
cancel-in-progress: false
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:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: yarn
- name: Build
run: yarn 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: "{.*/**,**}"

66
.github/workflows/docker-image.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Docker image
on:
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
type=sha
- 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
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

65
.github/workflows/pages.yml vendored Normal file
View File

@ -0,0 +1,65 @@
name: GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
tags:
- "v*.*.*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: yarn install
- 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
- name: Build
run: yarn build
- name: Redirect 404 to Index for SPA
run: cp dist/index.html dist/404.html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

33
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Release
on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Dependencies
run: yarn
- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
dist
node_modules
stats.html

4
.prettierignore Normal file
View File

@ -0,0 +1,4 @@
node_modules
dist
public/lib
stats.html

5
.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"tabWidth": 2,
"useTabs": false,
"printWidth": 120
}

18
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"cSpell.words": [
"Bech",
"Chakra",
"damus",
"lnurl",
"Msat",
"nostr",
"noStrudel",
"Npub",
"pubkeys",
"Sats",
"webln"
],
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"deno.enable": false
}