Add frontend compilation step to deploy.yml workflow #5
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: "Deploy To Server" | |
on: | |
push: | |
branches: [main, dev] | |
env: | |
DOKKU_REPO: "ssh://[email protected]:22/rails-backend" | |
DOKKU_DEPLOY_BRANCH: "main" | |
permissions: write-all | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Cloning repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js for frontend compilation | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Yarn | |
run: npm install -g yarn | |
- name: Build Frontend | |
run: | | |
cd frontend | |
yarn check --integrity || yarn install | |
yarn deploy | |
- name: Dokku | |
uses: dokku/[email protected] | |
with: | |
git_push_flags: '--force' | |
ssh_private_key: ${{ secrets.SSH_KEY }} | |
git_remote_url: ${{ env.DOKKU_REPO }} | |
branch: ${{ env.DOKKU_DEPLOY_BRANCH }} |