This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
chore(deps): bump @prisma/client from 4.15.0 to 5.10.2 #666
Workflow file for this run
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: Verify, Build, & Deploy | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
install: | |
name: Install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Node Modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
# Any way to encapsulate all of this with cache-hit? | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: Install Packages | |
run: npm ci --ignore-scripts | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: [install] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Cache Node Modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Linting | |
run: npm run lint | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
needs: [install] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Cache Node Modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Coverage | |
run: npm run test:coverage | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: [install] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Node Modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Cache NextJS | |
id: cache-nextjs | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- name: Build | |
run: npm run build | |
semantic: | |
name: Semantic Release | |
runs-on: ubuntu-latest | |
needs: [lint, coverage, build] | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
outputs: | |
published: ${{ steps.semantic.outputs.new_release_published }} | |
major: ${{ steps.semantic.outputs.new_release_major_version }} | |
minor: ${{ steps.semantic.outputs.new_release_minor_version }} | |
patch: ${{ steps.semantic.outputs.new_release_patch_version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy-docker: | |
name: Deploy (Docker Hub) | |
runs-on: ubuntu-latest | |
needs: semantic | |
if: needs.semantic.outputs.published == 'true' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Node Modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Cache NextJS | |
id: cache-nextjs | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: rainbowcafe/silvy | |
tags: | | |
type=raw,value=${{ needs.semantic.outputs.major }} | |
type=raw,value=${{ needs.semantic.outputs.major }}.${{ needs.semantic.outputs.minor }} | |
type=raw,value=${{ needs.semantic.outputs.major }}.${{ needs.semantic.outputs.minor }}.${{ needs.semantic.outputs.patch }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Push README to Dockerhub | |
uses: christian-korneck/update-container-description-action@v1 | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASS: ${{ secrets.DOCKER_PASSWORD }} | |
with: | |
destination_container_repo: rainbowcafe/silvy | |
provider: dockerhub | |
readme_file: 'README.md' | |
deploy-netlify: | |
name: Deploy (Netlify) | |
runs-on: ubuntu-latest | |
needs: semantic | |
if: needs.semantic.outputs.published == 'true' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Node Modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Cache NextJS | |
id: cache-nextjs | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- name: Deploy Database | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
run: npm run deploy:database | |
- name: Deploy to Netlify | |
run: curl -X POST ${{ secrets.DEPLOY_URL }} |