Skip to content

Updates node to LTS for pipelines #67

Updates node to LTS for pipelines

Updates node to LTS for pipelines #67

Workflow file for this run

name: Deploy PROD SPCom
on:
push:
branches:
- master
workflow_dispatch:
jobs:
web-deploy:
name: πŸŽ‰ Deploy
runs-on: ubuntu-latest
environment: Production
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v2
- name: 🚚 Prepare node
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: 🚚 Install dependencies
run: npm install
- name: πŸ”’ Generate and write ENV variables
uses: actions/github-script@v5
env:
MAIL_USER: '${{secrets.MAIL_USER}}'
MAIL_PASS: '${{secrets.MAIL_PASS}}'
MAIL_ADDRESS: '${{secrets.MAIL_ADDRESS}}'
SECURITY_SECRET: '${{secrets.SECURITY_SECRET}}'
SECURITY_HCAPTCHA_SECRET: '${{secrets.SECURITY_HCAPTCHA_SECRET}}'
with:
script: |
const fs = require('fs');
const { MAIL_USER, MAIL_PASS, MAIL_ADDRESS, SECURITY_SECRET, SECURITY_HCAPTCHA_SECRET } =
process.env;
await new Promise((resolve, reject) =>
fs.writeFile(
'.env',
`
# APP
APP_NAME=katr_prom
APP_ENV=production
APP_PREFIX=
APP_DEBUG=false
APP_URL=https://www.katr.cz
LANGUAGE="cs"
MORE_LANG="en"
# Mail
MAIL_HOST=email.active24.com
MAIL_PORT=465
MAIL_USER=${MAIL_USER}
MAIL_PASS=${MAIL_PASS}
MAIL_ADDRESS=${MAIL_ADDRESS}
# Security
SECURITY_SECRET=${SECURITY_SECRET}
SECURITY_HCAPTCHA_SECRET=${SECURITY_HCAPTCHA_SECRET}
`,
function (err) {
if (err) return reject();
resolve('');
}
)
);
- name: πŸ— Build the production build
run: npm run build
- name: Delete twig cache
uses: StephanThierry/[email protected]
with:
host: katr.cz
user: ${{ secrets.FTP_PROD_USER }}
password: ${{ secrets.FTP_PROD_PASS }}
remoteDirectories: "/cache/twig"
ignoreSSL: "1"
- name: πŸ“‚ Sync files
uses: SamKirkland/[email protected]
with:
server: katr.cz
username: ${{ secrets.FTP_PROD_USER }}
password: ${{ secrets.FTP_PROD_PASS }}
exclude: |
**/.git*/**
.git
.github/**
**/node_modules/**
public/images/**
subdoms/**
subdoms
cache/**
.gitignore
.prettierrc.js
docker-compose.yml
Dockerfile
globals.d.ts
tsconfig.json
webpack.config.js
package-lock.json