Update main.yml #9
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
# https://github.com/actions/deploy-pages#usage | ||
name: Deploy to Ukraina com ua | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
# Pick your own package manager and build script | ||
- name: Clean and install dependencies | ||
run: | | ||
rm -rf node_modules package-lock.json | ||
npm install --legacy-peer-deps | ||
- run: npx npm run generate | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./.output/public | ||
# Deployment job | ||
deploy: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
rm -rf node_modules package-lock.json | ||
npm install --legacy-peer-deps | ||
- name: Build the Nuxt 3 project | ||
run: | | ||
npx npm run generate | ||
- name: Deploy with rsync | ||
uses: burnett01/rsync-deployments@7.0.1 | ||
with: | ||
switches: -avzr --delete | ||
path: .output/public/ # Deploy only the built output directory | ||
remote_host: ${{ secrets.REMOTE_HOST }} | ||
remote_user: ${{ secrets.REMOTE_USER }} | ||
remote_key: ${{ secrets.REMOTE_KEY }} | ||
remote_path: ${{ secrets.REMOTE_PATH }} |