fix: reset active payment method and use correct invoice amount (#64) #151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
env: | |
DOCKERHUB_ORG: geprog | |
IMAGE_NAME: gringotts | |
jobs: | |
server: | |
name: Release server | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Cache pnpm modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: true | |
- name: Build client | |
working-directory: packages/client/ | |
run: pnpm build | |
- name: Build server | |
working-directory: packages/server/ | |
run: pnpm build | |
# install app again to respect shamefully hoisted dependencies | |
- name: Build app | |
working-directory: packages/app/ | |
run: | | |
pnpm install | |
pnpm build | |
- name: Build the Docker image | |
run: docker build --tag $IMAGE_NAME:latest --cache-from ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest . | |
- name: Log in to Github registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
if: github.event_name != 'pull_request' | |
- name: Push image to Github registry (latest & tag) | |
run: | | |
docker tag $IMAGE_NAME:latest ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest | |
docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest | |
docker tag $IMAGE_NAME:latest ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:${GITHUB_REF#refs/*/} | |
docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:${GITHUB_REF#refs/*/} | |
if: "github.ref_type == 'tag'" | |
- name: Push image to Github registry (next) | |
run: | | |
docker tag $IMAGE_NAME:latest ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:next | |
docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:next | |
if: github.event_name != 'pull_request' && github.ref_type != 'tag' | |
client: | |
name: Release client | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup git user | |
run: | | |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Cache pnpm modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: true | |
- name: Build | |
working-directory: packages/client/ | |
run: pnpm build | |
- name: Generate api docs | |
working-directory: packages/client/ | |
run: pnpm run generate:docs | |
- name: Set version | |
working-directory: packages/client/ | |
run: pnpm version ${GITHUB_REF#refs/*/} --no-commit-hooks --no-git-tag-version | |
if: "github.ref_type == 'tag'" | |
- name: Release | |
working-directory: packages/client/ | |
run: pnpm publish --no-git-check --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
if: "github.ref_type == 'tag'" | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: packages/client/docs/ | |
if: "github.ref_type == 'tag'" |