This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
👷 Add commit job to keep action enable #723
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
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
repo-sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: master-sync | |
uses: wei/git-sync@v2 | |
with: | |
source_repo: "https://git.savannah.nongnu.org/git/getfem.git" | |
source_branch: "refs/heads/master" | |
destination_repo: "git@github.com:getfem-doc/getfem.git" | |
destination_branch: "refs/heads/master" | |
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: tag-sync | |
uses: wei/git-sync@v2 | |
with: | |
source_repo: "https://git.savannah.nongnu.org/git/getfem.git" | |
source_branch: "refs/tags/*" | |
destination_repo: "git@github.com:getfem-doc/getfem.git" | |
destination_branch: "refs/tags/*" | |
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Get Job URL | |
uses: Tiryoh/gha-jobid-action@v0 | |
id: jobs | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
job_name: script | |
- name: Setup SSH | |
uses: MrSquaare/ssh-setup-action@v2 | |
with: | |
host: github.com | |
private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PERSONAL_ACCESSTOKEN }} | |
- name: git_config | |
env: | |
NAME: "getfem-auto-update" | |
EMAIL: "getfem-auto-update" | |
run: | | |
git branch -a | |
git config --global user.email $EMAIL | |
git config --global user.name $NAME | |
- name: commit | |
if: contains(github.event.head_commit.message, '[ci skip]') == false && contains(github.ref, 'master') | |
env: | |
ORGANIZATION: getfem-doc | |
REPO: getfem-github-actions | |
JOB_ID: ${{ steps.jobs.outputs.job_id }} | |
HTML_URL: ${{ steps.jobs.outputs.html_url }} | |
run: | | |
git add . | |
git commit --allow-empty -m "[ci skip] $JOB_ID | |
$HTML_URL" | |
git remote -v | |
git remote add github git@github.com:$ORGANIZATION/$REPO.git | |
git push github master |