| 1 | name: "Publish web" |
| 2 | on: |
| 3 | push: |
| 4 | branches: |
| 5 | - main |
| 6 | |
| 7 | env: |
| 8 | REACT_APP_SPLITFIRE_API_HOST: ${{ secrets.REACT_APP_SPLITFIRE_API_HOST }} |
| 9 | REACT_APP_MUSIK88_BASE_URL: ${{ secrets.REACT_APP_MUSIK88_BASE_URL }} |
| 10 | REACT_APP_ACTION_CABLE_URL: ${{ secrets.REACT_APP_ACTION_CABLE_URL }} |
| 11 | |
| 12 | jobs: |
| 13 | publish-web: |
| 14 | runs-on: ubuntu-latest |
| 15 | steps: |
| 16 | - uses: actions/checkout@v3 |
| 17 | - name: setup node |
| 18 | uses: actions/setup-node@v3 |
| 19 | with: |
| 20 | node-version: 16 |
| 21 | - name: Install frontend dependencies |
| 22 | run: yarn install |
| 23 | - name: Build |
| 24 | run: yarn build |
| 25 | - name: Install SSH key |
| 26 | uses: shimataro/ssh-key-action@v2 |
| 27 | with: |
| 28 | key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 29 | known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} |
| 30 | - name: rsync over SSH |
| 31 | run: rsync -r ./build/ deploy@splitfire.ai:/var/www/beta.splitfire.ai/build/ |