feat: add product api #16
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: Build and Deploy to Vercel | |
on: | |
push: | |
branches: ["master"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.author.name, 'GitHub Action')" | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
token: ${{ secrets.ACTION_TOKEN }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 14 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build Project | |
run: npm run build | |
- name: Save Build Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: | | |
build/**/* | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
token: ${{ secrets.ACTION_TOKEN }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-artifacts | |
path: build | |
- name: Deploy to Vercel | |
uses: amondnet/vercel-action@v25 | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required | |
github-token: ${{ secrets.ACTION_TOKEN }} # Optional | |
vercel-args: '--prod' # Optional | |
vercel-org-id: ${{ secrets.ORG_ID }} # Required | |
vercel-project-id: ${{ secrets.PROJECT_ID }} # Required | |
working-directory: ./ # Your Working Directory, Optional |