Updates node to LTS for pipelines #66
This file contains hidden or 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 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@v2 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - 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_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 |