-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
4,259 additions
and
4,248 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Deploy using SSH | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- master | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: "${{ github.repository }}" | ||
|
||
jobs: | ||
|
||
build: | ||
environment: ${{ github.ref_name == 'master' && 'production' || 'staging'}} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Metadata Extraction for Main Image | ||
id: meta_main | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and Push Main Image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: "{{defaultContext}}" | ||
push: true | ||
file: Dockerfile | ||
tags: "${{ steps.meta_main.outputs.tags }}" | ||
labels: ${{ steps.meta_main.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
secrets: | | ||
"env_variables=${{ secrets.ENV_VARIABLES}}" | ||
deploy: | ||
environment: ${{ github.ref_name == 'master' && 'production' || 'staging'}} | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Deploy to Staging | ||
uses: appleboy/[email protected] | ||
env: | ||
PROJECT_PATH: ${{ vars.PROJECT_PATH }} | ||
COMPOSE_FILE: ${{ vars.COMPOSE_FILE }} | ||
|
||
with: | ||
host: ${{ vars.REMOTE_HOST }} | ||
username: ${{ vars.REMOTE_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
port: 22 | ||
script_stop: true | ||
envs: PROJECT_PATH,COMPOSE_FILE | ||
script: | | ||
export COMPOSE_INTERACTIVE_NO_CLI=1 | ||
cd $PROJECT_PATH | ||
set -euxo pipefail | ||
git pull | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
docker compose -f ${{ vars.COMPOSE_FILE }} pull COMPOSE_NAME | ||
docker compose -f ${{ vars.COMPOSE_FILE }} up -d COMPOSE_NAME |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit "" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18 | ||
v20 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
build | ||
coverage | ||
yarn.lock | ||
yarn.lock | ||
*.yml | ||
*.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
afterInstall: yarn husky | ||
|
||
compressionLevel: mixed | ||
|
||
enableGlobalCache: false | ||
|
||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-after-install.cjs | ||
spec: "https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.6.0/bundles/@yarnpkg/plugin-after-install.js" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM node:20 AS builder | ||
|
||
WORKDIR /app | ||
|
||
RUN corepack enable | ||
|
||
COPY ./yarn.lock ./package.json ./.yarnrc.yml ./ | ||
|
||
COPY patches/ ./patches | ||
|
||
RUN yarn install | ||
|
||
COPY . . | ||
|
||
RUN --mount=type=secret,id=env_variables \ | ||
cat /run/secrets/env_variables > .env | ||
|
||
RUN yarn ioc-generate | ||
|
||
RUN yarn graphql | ||
|
||
RUN yarn build --base=/clientes/payments/ | ||
|
||
FROM nginx | ||
|
||
# delete default nginx static files | ||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
# copy build files from builder stage | ||
COPY --from=builder /app/dist /usr/share/nginx/html |
This file was deleted.
Oops, something went wrong.
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.