Skip to content

Merge pull request #19 from NextStepFinalProject/NXD-21 #19

Merge pull request #19 from NextStepFinalProject/NXD-21

Merge pull request #19 from NextStepFinalProject/NXD-21 #19

name: Backend - Deploy coverage report to Pages
on:
push:
branches: ['master']
workflow_dispatch:
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
deploy:
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: nextstep-backend
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create envfile
uses: SpicyPizza/create-envfile@v2.0.3
with:
envkey_PORT: 3000
envkey_DB_CONNECTION: mongodb://localhost:27017/app
envkey_ACCESS_TOKEN_SECRET: 2a955a8b802eab6c693ba116f5e1bc8d2d2cf5e5e83e579cecb3fc363fb077229a801e7392f348d3c370e2383169cab80f556421d3ec2186def5d36ed5a317b6
envkey_TOKEN_EXPIRATION: 30s
envkey_REFRESH_TOKEN_SECRET: 2a955a8b802eab6c693ba116f5e1bc8d2d2cf5e5e83e579cecb3fc363fb077229a801e7392f348d3c370e2383169cab80f556421d3ec2186def5d36ed5a317b6
envkey_REFRESH_TOKEN_EXPIRATION: 1d
file_name: nextstep-backend/.env
fail_on_empty: true
sort_keys: false
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: '6.0'
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm i
- name: Run tests
run: npm run test -- --testTimeout=30000
- name: Setup Pages
if: always()
uses: actions/configure-pages@v4
- name: Upload Artifact
if: always()
uses: actions/upload-pages-artifact@v3
with:
path: 'nextstep-backend/coverage/lcov-report'
name: github-pages-${{ github.run_id }}-${{ github.run_attempt }}
- name: Deploy to GitHub Pages
if: always()
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: github-pages-${{ github.run_id }}-${{ github.run_attempt }}