36 lines
879 B
YAML
36 lines
879 B
YAML
---
|
|
name: Push to GitHub
|
|
concurrency:
|
|
group: push-to-github
|
|
cancel-in-progress: false
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
mirror:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- run: |
|
|
git config --global user.name "${GIT_NAME}"
|
|
git config --global user.email "${GIT_EMAIL}"
|
|
git config --global credential.helper store
|
|
echo "https://${GIT_EMAIL//@/%40}:${GIT_TOKEN}@github.com" > ~/.git-credentials
|
|
env:
|
|
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
|
|
GIT_NAME: ${{ secrets.GIT_NAME }}
|
|
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
|
|
|
|
- run: |
|
|
git remote add github "${GIT_REPO_URL}" || git remote set-url github "${GIT_REPO_URL}"
|
|
git push github --mirror
|
|
env:
|
|
GIT_REPO_URL: ${{ secrets.GIT_REPO_URL }}
|