Skip to content

Update dependency faker to v19.3.1 #558

Update dependency faker to v19.3.1

Update dependency faker to v19.3.1 #558

Workflow file for this run

name: CI/CD
on: [push]
env:
BASE_URL_PREVIEW: bcardgen.vercel.app
BASE_URL_PRODUCTION: business-card-generator.vercel.app
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.4'
- name: Cache Python modules
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pipenv
pipenv install --dev --deploy
- name: Run QA
run: |
pipenv run inv qa
pipenv run coverage xml
- name: Publish code coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
deploy-vercel-setup:
name: Deployment setup
runs-on: ubuntu-latest
needs: test
outputs:
github_ref_slug: ${{ steps.output_step.outputs.github_ref_slug }}
deployment_url: ${{ steps.output_step.outputs.deployment_url }}
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Set preview deployment url variable
if: ${{ !contains(github.ref, 'tags') }}
run: echo "DEPLOYMENT_URL=https://${GITHUB_REF_SLUG_URL}-${BASE_URL_PREVIEW}" >> $GITHUB_ENV
- name: Set production deployment url variable
if: ${{ contains(github.ref, 'tags') }}
run: echo "DEPLOYMENT_URL=https://${BASE_URL_PRODUCTION}" >> $GITHUB_ENV
- id: output_step
run: |
echo "::set-output name=github_ref_slug::${GITHUB_REF_SLUG_URL}"
echo "::set-output name=deployment_url::${DEPLOYMENT_URL}"
deploy-vercel-preview:
name: Vercel preview deployment
runs-on: ubuntu-latest
needs: deploy-vercel-setup
if: ${{ !contains(github.ref, 'tags') }}
environment:
name: preview/${{ needs.deploy-vercel-setup.outputs.github_ref_slug }}
url: ${{ needs.deploy-vercel-setup.outputs.deployment_url }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Deploy to Vercel
run: |
VERCEL_ALIAS=${GITHUB_REF_SLUG_URL}-${BASE_URL_PREVIEW}
VERCEL_URL=$(vercel deploy --confirm --token $VERCEL_TOKEN)
vercel alias --token $VERCEL_TOKEN set $VERCEL_URL $VERCEL_ALIAS
deploy-vercel-production:
name: Vercel production deployment
runs-on: ubuntu-latest
needs: deploy-vercel-setup
if: contains(github.ref, 'tags')
environment:
name: production
url: ${{ needs.deploy-vercel-setup.outputs.deployment_url }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Deploy to Vercel
run: |
vercel deploy --confirm --token $VERCEL_TOKEN --prod