Skip to content

Merge pull request #367 from tier4/fix/remove-old-version-of-dependen… #239

Merge pull request #367 from tier4/fix/remove-old-version-of-dependen…

Merge pull request #367 from tier4/fix/remove-old-version-of-dependen… #239

name: mirror_repository
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
MIRROR_REPOSITORY_NAME: AWSIM-mirror
MIRROR_RIPOSITORY: [email protected]:tier4/AWSIM-mirror.git
GIT_NAME: mackierx111
GIT_MAILADDRESS: [email protected]
steps:
- uses: actions/checkout@v2
- name: set-git
run: |
git config --global user.name $GIT_NAME
git config --global user.email $GIT_MAILADDRESS
- name: set-ssh
run: |
mkdir ~/.ssh
chmod 700 ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: clone
run: |
mkdir ~/mirror
cd ~/mirror
git clone $MIRROR_RIPOSITORY
echo | ls -l ./
- name: delete
run: |
cd ~/mirror
cd $MIRROR_REPOSITORY_NAME
find . -mindepth 1 -maxdepth 1 ! -name ".git" -exec rm -r "{}" \;
echo | ls -a ./
- name: export
run: |
git archive --format=zip HEAD > ~/original.zip
echo | ls -l ~/original.zip
mkdir ~/original
unzip -o -d ~/$MIRROR_REPOSITORY_NAME ~/original.zip
echo | ls -l ~/$MIRROR_REPOSITORY_NAME
- name: copy
run: |
cp -r ~/$MIRROR_REPOSITORY_NAME ~/mirror
echo | ls -l ~/mirror/$MIRROR_REPOSITORY_NAME
- name: push
run: |
cd ~/mirror/$MIRROR_REPOSITORY_NAME
echo | ls -l
git diff
git add -A
git commit -m "mirror from original"
git push origin main