Chris
7f8d2e2523
Some checks failed
Build and push / Pulling repo on server (push) Failing after 19s
34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
name: Build and push
|
|
run-name: ${{ github.actor }} building dogstats
|
|
on: [push]
|
|
|
|
env:
|
|
REGISTRY: gitea.haschek.at
|
|
IMAGE_NAME: $(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
|
|
|
|
jobs:
|
|
pull-on-server:
|
|
#if: "contains(github.event.head_commit.message, 'push')"
|
|
name: Pulling repo on server
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Configure SSH
|
|
env:
|
|
SSH_KEY: ${{ secrets.SSH_KEY }}
|
|
run: |
|
|
mkdir -p ~/.ssh/
|
|
echo "$SSH_KEY" > ~/.ssh/staging.key
|
|
chmod 600 ~/.ssh/staging.key
|
|
- name: Run docker restart on Server
|
|
run: |
|
|
ssh -i ~/.ssh/staging.key -o StrictHostKeyChecking=no -p 22 -o UserKnownHostsFile=/dev/null ${{ secrets.SSH_WEBSERVER_IP }} "cd /var/www/dogstats/ && git pull"
|
|
|
|
- name: Getting repo
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: 'dogstats'
|
|
- name: Building minified CSS
|
|
run: cd dogstats/tools && ./tailwindcss-linux-x64 -i ../web/css/input.css -o ../web/css/output.css --minify
|
|
- name: Copying to server
|
|
run: scp -i ~/.ssh/staging.key -o StrictHostKeyChecking=no -p 22 -o UserKnownHostsFile=/dev/null ../web/css/output.css ${{ secrets.SSH_WEBSERVER_IP }}:/var/www/dogstats/web/css/output.css
|
|
|