Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LarvenStein authored Jul 5, 2024
1 parent 3b8b6a7 commit 93d99b6
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Build and deploy to FTP

on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: release-artifact
path: './dist'

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3

# Download the artifact we just created
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: release-artifact
path: './dist' # This is the path where the artifact will be downloaded to

- name: Sync files to FTP
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.ftpserver }}
username: ${{ secrets.ftpuser }}
password: ${{ secrets.ftppassword }}
local-dir: './dist/'
server-dir: '/'

0 comments on commit 93d99b6

Please sign in to comment.