41.0.0 #115
This file contains hidden or 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 Prod | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| name: ssh/pull/build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Pull code & Build | |
| uses: appleboy/ssh-action@v1.2.4 | |
| with: | |
| host: ${{ secrets.HOST }} | |
| port: ${{ secrets.PORT }} | |
| username: ${{ secrets.USERNAME }} | |
| password: ${{ secrets.PASSWORD }} | |
| script: | | |
| eval `ssh-agent -s` | |
| ssh-add ~/.ssh/${{ secrets.SSH_PUBLIC_KEY_NAME }} | |
| # Enable maintenance mode | |
| touch ${{ secrets.DIST }}/maintenance.enable | |
| # Deploy | |
| cd ${{ secrets.DIST }} | |
| git pull origin master | |
| npm ci | |
| npm run build | |
| # Disable maintenance mode | |
| rm ${{ secrets.DIST }}/maintenance.enable | |
| - name: Discord notification | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| DISCORD_USERNAME: "Github bot" | |
| DISCORD_AVATAR: "https://i.imgur.com/lPRYnJx.png" | |
| uses: Ilshidur/action-discord@master | |
| with: | |
| args: | | |
| New version has been deployed on squadcalc.app ! | |
| **Full Changelog**: https://github.com/sh4rkman/SquadCalc/blob/master/CHANGELOG.md | |
| **Commit**: ${{ github.event.head_commit.message }} |