clean up comment #122
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
on: push | |
name: π Deploy website | |
jobs: | |
staging: | |
name: π Staging | |
runs-on: ubuntu-latest | |
environment: | |
name: STAGING | |
url: https://uus.tori.ee/ | |
steps: | |
- name: π Get latest code | |
uses: actions/checkout@v3 | |
- name: β Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: π Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: π¨ Build Project | |
run: | | |
npm ci | |
npm run build:prod | |
- name: βοΈ Create .env file | |
run: | | |
echo '${{ secrets.RECAPTCHA }}' > ./dist/.env | |
echo '${{ vars.RECIPIENT }}' >> ./dist/.env | |
- name: π Sync files | |
uses: SamKirkland/[email protected] | |
with: | |
local-dir: ./dist/ | |
server: tori.ee | |
username: staging.tori.ee | |
password: ${{ secrets.PASSWORD }} | |
protocol: ftps | |
production: | |
name: πΎ Production | |
runs-on: ubuntu-latest | |
environment: | |
name: PROD | |
url: https://tori.ee/ | |
needs: [staging] | |
steps: | |
- name: π Get latest code | |
uses: actions/checkout@v3 | |
- name: β Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: π Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: π¨ Build Project | |
run: | | |
npm ci | |
npm run build:prod | |
- name: βοΈ Create .env file | |
run: | | |
echo '${{ secrets.RECAPTCHA }}' > ./dist/.env | |
echo '${{ vars.RECIPIENT }}' >> ./dist/.env | |
- name: π Sync files | |
uses: SamKirkland/[email protected] | |
with: | |
local-dir: ./dist/ | |
server: tori.ee | |
username: production.tori.ee | |
password: ${{ secrets.PASSWORD }} | |
protocol: ftps |