Setup CI #1
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: [push] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Node.js | |
uses: actions/set up-node@v4 | |
with: | |
node-version: "16.x" | |
check-latest: true | |
cache: "npm" | |
cache-dependency-path: "package-lock.json" | |
- name: Compile with Gulp | |
run: | | |
gulp styles | |
gulp js | |
- name: Upload artifacts | |
uses: actions/upload-artifact@master | |
with: | |
name: sassy_biotheme | |
path: dist/ | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@master | |
with: | |
name: sassy_biotheme | |
path: dist/ | |
- name: Copy files to server | |
uses: appleboy/scp-action@v0.1.7 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
source: "dist/sassy_biotheme" | |
target: ${{ secrets.TARGET }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
rm: true |