Merge pull request #129 from HolodexNet/dev #33
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 Musicdex (Production) | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: SSH and Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script_stop: true | |
script: | | |
cd /opt/prod_musicdex || { echo "No directory found"; exit 1; } | |
git pull origin master | |
yarn --frozen-lockfile | |
yarn run build | |
rm -r /var/www/html/music.holodex.net/* | |
cp -r build/* /var/www/html/music.holodex.net/ | |
- name: Purge Cloudflare Cache | |
uses: indiesdev/[email protected] | |
with: | |
url: "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" | |
method: "POST" | |
headers: '{ "X-Auth-Key": "${{ secrets.CLOUDFLARE_AUTH_KEY_XRAVE }}", "X-Auth-Email": "${{ secrets.CLOUDFLARE_AUTH_EMAIL_XRAVE }}", "Content-Type": "application/json" }' | |
body: '{"files":["https://music.holodex.net/index.html", "https://music.holodex.net/service-worker.js"]}' | |
timeout: 10000 | |
retries: 3 |