Skip to content

641 add sequence navigation buttons (#642) #74

641 add sequence navigation buttons (#642)

641 add sequence navigation buttons (#642) #74

name: Build & Deploy AWS Staging CI
on:
push:
branches: [staging]
jobs:
build_bp_gallery:
name: Build & Deploy bp-gallery
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./projects/bp-gallery
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install bp-gallery dependencies
run: yarn install --frozen-lockfile
- name: Install bp-graphql dependencies
working-directory: ./projects/bp-graphql
run: yarn install --frozen-lockfile && tsc
- name: Generate APIConnector
run: yarn generate-api
- name: Build bp-gallery
run: yarn build:dev
- name: Deploy build files on the server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.AWS_REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.AWS_SSH_KEY }}
source: "projects/bp-gallery/build/"
strip_components: 3
target: ${{ secrets.AWS_REMOTE_STAGING_TARGET }}
rm: true
build_bp_strapi:
name: Build & Deploy bp-strapi
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./projects/bp-strapi
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Set up SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ./deploy_key
sudo chmod 600 ./deploy_key
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
shell: bash
env:
SSH_KEY: ${{secrets.AWS_SSH_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.AWS_SSH_KNOWN_HOSTS}}
- name: Install PM2 for deployment
run: yarn global add pm2
- name: Deploy strapi on the server
run: pm2 deploy ecosystem.aws.config.js staging
env:
REMOTE_HOST: ${{secrets.AWS_REMOTE_HOST}}
REMOTE_USER: ${{secrets.REMOTE_USER}}