Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifailon committed Oct 5, 2024
1 parent cb8dc56 commit c6ca440
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Build and Push
name: Deploy to Docker Hub

on:
workflow_dispatch:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cd-vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
- name: Install dependencies
run: npm install

- uses: amondnet/vercel-action@v25
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/ci-curl-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ on:
required: false
default: false
type: boolean
Vercel:
description: 'Deploy to Vercel'
required: false
default: false
type: boolean
# push:
# branches:
# - main
# schedule:
# - cron: '0 12 * * *'

jobs:
build:
Expand Down Expand Up @@ -563,19 +553,4 @@ jobs:
docker push lifailon/torapi:latest
else
echo Skip
fi
- name: Deploy to Vercel
run: |
if [ "${{ github.event.inputs.Vercel }}" = "true" ]; then
npm install
echo
npm install --global vercel@latest
echo
echo Vercel version:
vercel --version
echo
vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} --yes
else
echo Skip
fi
43 changes: 37 additions & 6 deletions .github/workflows/ci-postman-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ on:
- 'not'
- 'GitHub'
- 'DockerHub'
# Docker:
# description: 'Build docker image from GitHub'
# required: false
# default: false
# type: boolean
DeployDocker:
description: 'Deploy to Docker Hub'
required: false
default: false
type: boolean
DeployVercel:
description: 'Deploy to Vercel'
required: false
default: false
type: boolean

jobs:
build:
Expand Down Expand Up @@ -137,4 +142,30 @@ jobs:
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: '**/postman-results.xml'
report_paths: '**/postman-results.xml'

- name: Login to Docker Hub
if: ${{ github.event.inputs.DeployDocker == 'true' && success() }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Deploy to Docker Hub
if: ${{ github.event.inputs.DeployDocker == 'true' && success() }}
run: |
docker build -t lifailon/torapi:latest .
docker push lifailon/torapi:latest
- name: Install dependencies for deploy to Vercel
if: ${{ github.event.inputs.DeployVercel == 'true' && success() }}
run: npm install

- name: Deploy to Vercel
if: ${{ github.event.inputs.DeployVercel == 'true' && success() }}
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions" src="https://img.shields.io/badge/Actions-%230075A8.svg?style=for-the-badge&logo=githubactions&logoColor=white"></a>
<br>
<br>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/ci-docker.yml?logo=GitHub-Actions&label=CI+Docker"></a>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/cd-docker-hub.yml?logo=GitHub-Actions&label=CI+Docker+Hub"></a>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/cd-vercel.yml?logo=Vercel&label=CD+Vercel"></a>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/ci-postman-tests.yml?logo=Postman&label=Postman+Tests"></a>
<a href="https://app.swaggerhub.com/apis-docs/Lifailon/TorAPI"><img title="Swagger"src="https://img.shields.io/swagger/valid/3.0?specUrl=https%3A%2F%2Fraw.githubusercontent.com%2FLifailon%2FTorAPI%2Fmain%2Fswagger%2Fswagger.yaml&logo=Swagger&label=Swagger"></a>
Expand Down Expand Up @@ -241,25 +241,25 @@ newman run postman-tests.json \
--env-var "queryAllPage=test" \
--env-var "baseUrl=http://localhost:8443"
...
┌─────────────────────────┬────────────────────┬───────────────────┐
│ │ executed │ failed │
├─────────────────────────┼────────────────────┼───────────────────┤
│ iterations │ 1 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ requests │ 29 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ test-scripts │ 75 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ prerequest-scripts │ 62 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ assertions │ 133 │ 0 │
├─────────────────────────┴────────────────────┴───────────────────┤
│ total run duration: 29.4s
├──────────────────────────────────────────────────────────────────┤
│ total data received: 1.6MB (approx) │
├──────────────────────────────────────────────────────────────────┤
│ average response time: 969ms [min: 3ms, max: 5.8s, s.d.: 1372ms] │
└──────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────┬───────────────────
│ │ executed │ failed │
├─────────────────────────┼────────────────────┼───────────────────
│ iterations │ 1 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ requests │ 29 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ test-scripts │ 75 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ prerequest-scripts │ 62 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ assertions │ 135 │ 0 │
├─────────────────────────┴────────────────────┴───────────────────
│ total run duration: 30.6s
├──────────────────────────────────────────────────────────────────
│ total data received: 1.58MB (approx) │
├──────────────────────────────────────────────────────────────────
│ average response time: 1012ms [min: 2ms, max: 6.5s, s.d.: 1507ms] │
└──────────────────────────────────────────────────────────────────
```

---
Expand Down
40 changes: 20 additions & 20 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions" src="https://img.shields.io/badge/Actions-%230075A8.svg?style=for-the-badge&logo=githubactions&logoColor=white"></a>
<br>
<br>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/ci-docker.yml?logo=GitHub-Actions&label=CI+Docker"></a>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/cd-docker-hub.yml?logo=GitHub-Actions&label=CI+Docker+Hub"></a>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/cd-vercel.yml?logo=Vercel&label=CD+Vercel"></a>
<a href="https://github.com/Lifailon/TorAPI/actions"><img title="Actions"src="https://img.shields.io/github/actions/workflow/status/Lifailon/TorAPI/ci-postman-tests.yml?logo=Postman&label=Postman+Tests"></a>
<a href="https://app.swaggerhub.com/apis-docs/Lifailon/TorAPI"><img title="Swagger"src="https://img.shields.io/swagger/valid/3.0?specUrl=https%3A%2F%2Fraw.githubusercontent.com%2FLifailon%2FTorAPI%2Fmain%2Fswagger%2Fswagger.yaml&logo=Swagger&label=Swagger"></a>
Expand Down Expand Up @@ -241,25 +241,25 @@ newman run postman-tests.json \
--env-var "queryAllPage=test" \
--env-var "baseUrl=http://localhost:8443"
...
┌─────────────────────────┬────────────────────┬───────────────────┐
│ │ executed │ failed │
├─────────────────────────┼────────────────────┼───────────────────┤
│ iterations │ 1 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ requests │ 29 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ test-scripts │ 75 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ prerequest-scripts │ 62 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────┤
│ assertions │ 133 │ 0 │
├─────────────────────────┴────────────────────┴───────────────────┤
│ total run duration: 29.4s
├──────────────────────────────────────────────────────────────────┤
│ total data received: 1.6MB (approx) │
├──────────────────────────────────────────────────────────────────┤
│ average response time: 969ms [min: 3ms, max: 5.8s, s.d.: 1372ms] │
└──────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────┬───────────────────
│ │ executed │ failed │
├─────────────────────────┼────────────────────┼───────────────────
│ iterations │ 1 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ requests │ 29 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ test-scripts │ 75 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ prerequest-scripts │ 62 │ 0 │
├─────────────────────────┼────────────────────┼───────────────────
│ assertions │ 135 │ 0 │
├─────────────────────────┴────────────────────┴───────────────────
│ total run duration: 30.6s
├──────────────────────────────────────────────────────────────────
│ total data received: 1.58MB (approx) │
├──────────────────────────────────────────────────────────────────
│ average response time: 1012ms [min: 2ms, max: 6.5s, s.d.: 1507ms] │
└──────────────────────────────────────────────────────────────────
```

---
Expand Down

0 comments on commit c6ca440

Please sign in to comment.