Skip to content

Merge pull request #2 from clydedsouza/revert-1-nextjs #32

Merge pull request #2 from clydedsouza/revert-1-nextjs

Merge pull request #2 from clydedsouza/revert-1-nextjs #32

Workflow file for this run

name: Build and deploy API
on:
push:
branches:
- main
paths-ignore:
- "web/**"
- "images/**"
pull_request:
branches:
- main
paths-ignore:
- "web/**"
- "images/**"
jobs:
build_api:
name: Build API
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: api
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install NPM packages
run: npm ci
- name: Generate API files
run: npm run generate:api
- name: Upload API files
uses: actions/upload-artifact@v3
with:
path: ./api/public
deploy_api:
name: Deploy API
runs-on: ubuntu-latest
needs: build_api
if: |
success() &&
github.ref == 'refs/heads/main'
defaults:
run:
shell: bash
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: artifact
- name: Deploy artifacts to the API repo
uses: tagus/[email protected]
with:
changes: artifact
repository: [email protected]:clydedsouza/clydedsouza-web-api.git
ssh_key: ${{ secrets.API_REPO_DEPLOY_KEY }}
name: clydedsouza
email: [email protected]
clean_repo: true
branch: main
message: "Commit from the monorepo API deploy job"