Appearance
Github actions
GitHub Actions facilitate and automate development. Creating the largest possible set of ready-to-use workflow
files allows you to save a lot of time.
Releases
Each repository should have the process of issuing subsequent versions.The action of creating a new release is located in semantic release.
FTP upload
If you need to build a straight static page, send the dist
directory to the server, or, for example, sending files to the FTP server, just use the following workflow
.
yaml
name: Publish to ftp
on:
push:
branches: [ftp]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Node.JS
uses: actions/setup-node@v2
with:
node-version: 17.x
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Upload ftp
uses: SamKirkland/FTP-Deploy-Action@4.3.0
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: 'dist/'
server-dir: '/'
port: 21
Testing
Simple workflow building and testing before making merge
.
yaml
name: Merge to main
on:
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: npm install && npm run test:unit