Scheduled Deploy #1140
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: Scheduled Deploy | |
on: | |
schedule: | |
# https://crontab.guru/#33_1/6_*_*_* | |
- cron: "33 1/6 * * *" | |
# CSS Naked Day | |
- cron: "0 10 8 4 *" | |
- cron: "0 12 10 4 *" | |
# JS Naked Day | |
- cron: "0 10 23 4 *" | |
- cron: "0 12 25 4 *" | |
concurrency: | |
group: deploy | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Scheduled Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Install | |
uses: ./.github/actions/install | |
- name: Test | |
uses: ./.github/actions/test | |
- name: Build | |
uses: ./.github/actions/build | |
env: | |
NODE_OPTIONS: "--max_old_space_size=8192" | |
LASTFM_API_TOKEN: ${{ secrets.LASTFM_API_TOKEN }} | |
MUSICTHREAD_API_KEY: ${{ secrets.MUSICTHREAD_API_KEY }} | |
PERSONAL_API_KEY: ${{ secrets.PERSONAL_API_KEY }} | |
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }} | |
TRAKT_CLIENT_ID: ${{ secrets.TRAKT_CLIENT_ID }} | |
VIGENERE_SECRET: ${{ secrets.VIGENERE_SECRET }} | |
WEBMENTION_IO_TOKEN: ${{ secrets.WEBMENTION_IO_TOKEN }} | |
- name: Check Build | |
uses: ./.github/actions/check | |
- name: Copy files to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.DEPLOY_KEY }} | |
rm: true | |
source: "_site/*" | |
target: "${{ secrets.DEPLOY_PATH }}build" | |
strip_components: 1 | |
- name: Process on server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.DEPLOY_KEY }} | |
script: "${{ secrets.DEPLOY_PATH }}${{ secrets.DEPLOY_FILE }}" |