Merge pull request #14 from roocker/cms/projects/demo/index #19
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
name: Build and Deploy | |
on: | |
# Trigger the workflow every time you push to the `main` branch | |
# Using a different branch name? Replace `main` with your branch’s name | |
push: | |
branches: [master] | |
# Allows you to run this workflow manually from the Actions tab on GitHub. | |
# workflow_dispatch: | |
# Allow this job to clone the repo and create a page deployment | |
# permissions: | |
# contents: read | |
# pages: write | |
# id-token: write | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "We are trying to build and deploy sth now. This got triggered by ${{ github.event_name }}. good luck." | |
- run: echo "running on ${{ runner.os }}" | |
- run: echo "branch ${{ github.ref }} of repo ${{ github.repository }}" | |
- run: echo "status ${{ job.status }}" | |
- name: Checkout your repository using git | |
uses: actions/checkout@v4 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18.18.2" | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: copy files to server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
port: ${{ secrets.SSH_PORT }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIV_KEY }} | |
passphrase: ${{ secrets.SSH_PASSPHRASE }} | |
source: "dist/,docker-compose.yml" | |
target: ${{ secrets.SSH_PATH }} | |
# debug: true | |
# script: | | |
# whoami |