Skip to content

Commit

Permalink
add production deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
siimsams committed Jul 27, 2023
1 parent 78b09b8 commit f8917ea
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,49 @@ jobs:
with:
local-dir: ./dist/
server: tori.ee
username: siim.tori.ee
password: ${{ secrets.password }}
protocol: ftps
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

0 comments on commit f8917ea

Please sign in to comment.