Release 2023-10-10 (#54) Plan-F-Check #17
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: Push production to server | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Build & Deploy | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- run: npm ci | |
- name: Create .env with Github Secrets and run script | |
run: | | |
touch .env | |
echo GATSBY_BACKEND_URL=$GATSBY_BACKEND_URL >> .env | |
echo STRAPI_TOKEN=$STRAPI_TOKEN >> .env | |
env: | |
GATSBY_BACKEND_URL: 'https://backend.plan-f.info' | |
STRAPI_TOKEN: ${{ secrets.STRAPI_TOKEN }} | |
- run: npm run build | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: '0ß2ndghg923hfgogz0hwlcjfg9iot' | |
- name: Adding Known Hosts | |
run: ssh-keyscan -H ${{ secrets.HOST }} >> ~/.ssh/known_hosts | |
- run: rsync -avz --delete ./public/ .htaccess ${{ secrets.USERNAME }}@${{ secrets.HOST }}:${{ secrets.TARGET }} |