Update action files #358
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: Staging deployment | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '!v*' | |
jobs: | |
test-and-lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Begin CI... | |
uses: actions/checkout@v2 | |
- name: Use NodeJS ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Use cached node_modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: nodeModules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
nodeModules- | |
- name: Install dependencies | |
run: npm ci | |
env: | |
CI: true | |
- name: Type check | |
run: npm run typecheck | |
env: | |
CI: true | |
# - name: Lint | |
# run: npm run lint | |
# env: | |
# CI: true | |
# - name: Test | |
# run: npm run test | |
# env: | |
# CI: true | |
- name: Build | |
run: npm run build | |
env: | |
CI: true | |
vercel-deploy: | |
runs-on: ubuntu-latest | |
needs: [test-and-lint] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Deploy to Vercel staging | |
run: | | |
VERCEL_ORG_ID=${{ secrets.VERCEL_ORG_ID }} \ | |
VERCEL_PROJECT_ID=${{ secrets.VERCEL_PROJECT_ID }} \ | |
npx vercel \ | |
--token ${{ secrets.VERCEL_TOKEN }} | |
docker-hub-deploy: | |
runs-on: ubuntu-latest | |
needs: [test-and-lint] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Deploy to Docker Hub production | |
env: | |
CI_CONTAINER_REGISTRY: ${{ secrets.CI_CONTAINER_REGISTRY }} | |
CI_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.CI_CONTAINER_REGISTRY_PASSWORD }} | |
CI_CONTAINER_REGISTRY_USERNAME: ${{ secrets.CI_CONTAINER_REGISTRY_USERNAME }} | |
run: | | |
npx mersocarlin-deployer \ | |
--provider dockerHub \ | |
--container-registry-host $CI_CONTAINER_REGISTRY \ | |
--container-registry-username $CI_CONTAINER_REGISTRY_USERNAME \ | |
--container-registry-password $CI_CONTAINER_REGISTRY_PASSWORD \ | |
--dockerfile-path Dockerfile.prod \ | |
--repository-name $CI_CONTAINER_REGISTRY_REPOSITORY_NAME \ | |
--repository-tag mersocarlin.staging \ | |
--verbose |