diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml new file mode 100644 index 0000000..091463c --- /dev/null +++ b/.forgejo/workflows/deploy.yaml @@ -0,0 +1,35 @@ +on: + push: + branches: + - main + +jobs: + build: + runs-on: docker + container: + image: docker.io/library/alpine + steps: + - name: Pipeline info + run: | + echo "Run triggered by ${{ github.event_name }} (${{ github.event.action }}) on ref ${{ github.ref_name }}" + + - name: Install packages + run: | + apk update + # For CI actions. + apk add nodejs-current git + # For uploading. + apk add rsync openssh + + - uses: actions/checkout@v4 + + - name: Prepare keys + run: | + echo "${{ secrets.SSH_DEPLOY_KEY }}" > deploykey.priv + chmod 400 deploykey.priv + echo "${{ secrets.SSH_KNOWN_HOSTS_FILE }}" > ./known_hosts + + - name: Upload styleguide + if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref_name == 'main' + run: | + rsync -v -r --delete -e "ssh -i deploykey.priv -o 'UserKnownHostsFile ./known_hosts'" styleguide/ eh22-styleguide-deploy@eh22-wiki-intern.hamburg.ccc.de:/var/www/eh22-styleguide/