Files
portfolio/.github/workflows/deploy.yml
dependabot[bot] a7819b20d8 chore(deps): Bump actions/checkout from 5 to 6 in /.github/workflows
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 22:21:50 +00:00

72 lines
1.8 KiB
YAML

name: Deploy to server
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'pnpm'
- name: Install dependencies and build
run: |
pnpm install --frozen-lockfile
pnpm run build
env:
VITE_GITHUB_TOKEN: ${{ secrets.VITE_GITHUB_TOKEN }}
VITE_EMAILJS_SERVICE_ID: ${{ secrets.VITE_EMAILJS_SERVICE_ID }}
VITE_EMAILJS_TEMPLATE_ID: ${{ secrets.VITE_EMAILJS_TEMPLATE_ID }}
VITE_EMAILJS_USER_ID: ${{ secrets.VITE_EMAILJS_USER_ID }}
- name: Install Cypress binary
run: pnpx cypress install
- name: Install http-server
run: pnpm add -D http-server
- name: Start HTTP server
run: pnpx http-server ./dist -p 8080 &
env:
CI: true
- name: Run Cypress tests and Browserslist
run: pnpm run test
env:
CYPRESS_baseUrl: http://localhost:8080
- name: Upload Cypress screenshots
if: failure()
uses: actions/upload-artifact@v5
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Copy build directory to server
uses: Dylan700/sftp-upload-action@v1.2.3
with:
server: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }}
uploads: |
./dist => /webroot/
delete: true