.github/workflows/frontend-cd.yml
name: Front-end CD
on:
push:
branches:
- master
- main
jobs:
frontend-cd:
runs-on: ubuntu-18.04
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v2
- name: Build front-end image
run: docker build -t frontend .
- name: Build production app
run: |
docker run\
--volume ${PWD}:/client\
frontend bash -c "yarn && yarn build"
- name: 🚀 Deploy front-end app to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: ./client/dist/spa
production-branch: master
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: false
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NODE_ENV: production
timeout-minutes: 2