feat: 🚀 Updated information, added posthog #7
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: 🚀 Deploy Web | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: 🔐 Create Production Environment File | |
run: | | |
touch .env | |
echo NEXT_PUBLIC_HCAPTCHA = ${{ secrets.NEXT_PUBLIC_HCAPTCHA }} >> .env | |
echo NEXT_PUBLIC_EMAILJS_SERVICE_ID = ${{ secrets.NEXT_PUBLIC_EMAILJS_SERVICE_ID }} >> .env | |
echo NEXT_PUBLIC_EMAILJS_TEMPLATE_ID = ${{ secrets.NEXT_PUBLIC_EMAILJS_TEMPLATE_ID }} >> .env | |
echo NEXT_PUBLIC_EMAILJS_PUBLIC_KEY = ${{ secrets.NEXT_PUBLIC_EMAILJS_PUBLIC_KEY }} >> .env | |
echo NEXT_PUBLIC_POSTHOG_KEY = ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }} >> .env | |
echo NEXT_PUBLIC_POSTHOG_HOST = ${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }} >> .env | |
echo NODE_ENV = ${{ secrets.NODE_ENV }} >> .env | |
- run: npm install | |
- run: npm run build | |
- run: pm2 restart trejocode.com | |
- run: pm2 save |