-
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.
Merge branch 'main' of github.com:Zafei-Erin/NFT_MKP
- Loading branch information
Showing
7 changed files
with
113 additions
and
77 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,35 @@ | ||
name: Backend-cd | ||
|
||
on: | ||
pull_request: | ||
types: [labeled] | ||
|
||
jobs: | ||
deploy-git: | ||
if: "${{ github.event.label.name == 'prod: backend' }}" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Remove deploy label | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: "prod: backend" | ||
|
||
deploy-aws: | ||
needs: deploy-git | ||
runs-on: aws-nft | ||
|
||
steps: | ||
- name: stop old image | ||
run: sudo docker-compose stop | ||
- name: remove old image | ||
run: sudo docker-compose rm -f | ||
- name: pull new image | ||
run: sudo docker-compose pull | ||
- name: run new image | ||
run: sudo docker-compose up -d | ||
- name: prune images | ||
run: sudo docker image prune -af |
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,64 @@ | ||
name: Backend-ci | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: "backend/**" | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
paths: "backend/**" | ||
|
||
jobs: | ||
git-ci: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Remove deploy label | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: "deploy: backend" | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: "npm" | ||
cache-dependency-path: "backend/package-lock.json" | ||
|
||
- name: Install deps | ||
run: npm install | ||
working-directory: "backend" | ||
|
||
- name: Run ci | ||
run: npm ci | ||
working-directory: "backend" | ||
|
||
docker-push: | ||
needs: git-ci | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: print location | ||
run: pwd | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./backend | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/nft-mkp-api:latest |
19 changes: 12 additions & 7 deletions
19
.github/workflows/ci.yaml → .github/workflows/Frontend-ci.yaml
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,32 +1,37 @@ | ||
name: CI | ||
name: Frontend-ci | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: 'frontend/**' | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
paths: 'frontend/**' | ||
|
||
jobs: | ||
test: | ||
git-ci: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: { dir: ["backend", "frontend", "smart_contract"] } | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Remove deploy label | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: "deploy: frontend" | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: "npm" | ||
cache-dependency-path: "**/package-lock.json" | ||
cache-dependency-path: "frontend/package-lock.json" | ||
|
||
- name: Install deps | ||
run: npm install | ||
working-directory: ${{ matrix.dir }} | ||
working-directory: "frontend" | ||
|
||
- name: Run ci | ||
run: npm ci | ||
working-directory: ${{ matrix.dir }} | ||
working-directory: "frontend" |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ app.use(errorHandler); | |
app.use(router); | ||
|
||
app.listen(port, () => console.log(`Server running on port ${port}`)); | ||
|
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 |
---|---|---|
|
@@ -12,3 +12,4 @@ ReactDOM.createRoot(document.getElementById("root")!).render( | |
</BrowserRouter> | ||
</React.StrictMode> | ||
); | ||
|