added fallback to make sure datasets is always a list when generating… #358
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: WordPane Build and Deploy | |
on: | |
push: | |
branches: [main, dev] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "20" | |
- name: Install Dependencies | |
run: cd wordpane && npm install | |
- name: Build | |
run: cd wordpane && npm run build | |
- name: Set Target Directory | |
run: | | |
if [ "${{ github.ref }}" == "refs/heads/dev" ]; then | |
echo "TARGET_DIR=/home/ec2-user/wordpane-dev" >> $GITHUB_ENV | |
else | |
echo "TARGET_DIR=/home/ec2-user/wordpane-prod" >> $GITHUB_ENV | |
fi | |
- name: Deploy to Server | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.DEPLOYMENT_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan 44.208.84.199 >> ~/.ssh/known_hosts | |
scp -i ~/.ssh/id_rsa -r ./wordpane/dist/* [email protected]:$TARGET_DIR | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOYMENT_KEY }} |