argoproj #18
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
name: argoproj | |
on: | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'run action reason' | |
required: false | |
type: string | |
default: 'manually test' | |
schedule: | |
- cron: '5 0 */6 * *' | |
push: | |
branches: | |
- main | |
- dev | |
- bug/** | |
- fix/** | |
- bugfix/** | |
- feature/** | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
orgs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- github: argoproj | |
gitee: argoproj | |
steps: | |
# https://github.com/actions/cache/blob/main/restore/README.md#outputs | |
- name: Restore cached repo | |
id: restore-cached-repo | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
${{ github.workspace }}/git-mirrors-cache | |
key: ${{ runner.os }}-${{ matrix.github }}-cache | |
- name: Organization ${{ matrix.github }} mirror | |
if: ${{ always() }} | |
uses: x-actions/git-mirrors@main | |
with: | |
src: github/${{ matrix.github }} | |
src_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
dst: gitee/${{ matrix.gitee }} | |
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} | |
dst_token: ${{ secrets.GITEE_TOKEN }} | |
account_type: org | |
clone_style: ssh | |
debug: true | |
- name: Print cache path | |
continue-on-error: true | |
run: | | |
set -x | |
echo "whoami is `whoami`" | |
dir="${{ github.workspace }}/git-mirrors-cache" | |
if [ -d "${dir}" ]; then | |
sudo chmod a+r -R ${dir} | |
ls -lhart ${dir} | |
tree -L 2 ${dir} | |
du -lh -d 1 | |
else | |
echo "empty" | |
fi | |
# https://github.com/actions/cache/blob/main/save/README.md | |
- name: Save repo cache | |
id: save-repo-cache | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
${{ github.workspace }}/git-mirrors-cache | |
key: ${{ steps.restore-cached-repo.outputs.cache-primary-key }} |