chore: update workflow for nuxt #497
Workflow file for this run
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 | |
on: | |
push: | |
branches: | |
- master # default branch | |
- chore-nuxt-deploy # Test only | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v5 | |
with: | |
node-version: '22' | |
# https://github.com/actions/cache/blob/v4/examples.md#node---npm | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v4 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run generate | |
- name: Copy files via SSH | |
uses: appleboy/scp-action@v1 | |
with: | |
host: ${{ secrets.IP }} | |
username: aosc | |
key: ${{ secrets.KEY }} | |
source: "dist/*" | |
target: /home/aosc/web/website-nuxt #Test bnly | |
rm: true | |
strip_components: 1 |