Merge pull request #54 from yyxcv/dev #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: | |
branches: | |
- dev # Change this to your default branch if it's not 'main' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.13' # Specify the Node.js version you need | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Install dependencies | |
run: yarn install | |
- name: Build project | |
run: yarn build | |
- name: Save build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: dist/** | |
download-pois: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.13' # Specify the Node.js version you need | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Install dependencies | |
run: yarn install | |
- name: Download POI Files | |
run: yarn pois | |
- name: Save build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pois | |
path: src/data/osm-overpass/** | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build, download-pois] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: dist | |
- name: Download pois | |
uses: actions/download-artifact@v4 | |
with: | |
name: pois | |
path: dist/data/osm-overpass | |
- name: Deploy to FTP server | |
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
port: ${{ secrets.FTP_PORT }} | |
protocol: ${{ secrets.FTP_PROTOCOL }} | |
server-dir: ${{ secrets.FTP_SERVER_DIR }} | |
local-dir: './dist/' |