Skip to content

New github workflow: git pull & commit from the web server #6

@gwynforthewyn

Description

@gwynforthewyn

A workflow is needed to simply do some ssh-adding and a git pull:

`name: Sync from server

on:
schedule:
- cron: '0 4 * * *' # daily at 4am UTC
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

  - name: Setup SSH
    run: |
      mkdir -p ~/.ssh
      echo "${{ secrets.SERVER_SSH_KEY }}" > ~/.ssh/id_ed25519
      chmod 600 ~/.ssh/id_ed25519
      ssh-keyscan yourserver.com >> ~/.ssh/known_hosts
      
  - name: Pull from server
    run: |
      git remote add server ssh://you@yourserver.com/path/to/content
      git fetch server
      git merge server/main --no-edit
      
  - name: Push to GitHub
    run: git push`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions