Actions (Tangled Mirror): More permissions changes #15
This file contains hidden or 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: Mirror Repo to Tangled.org | |
| on: | |
| workflow_dispatch: | |
| push: | |
| concurrency: | |
| group: tangled-mirror | |
| cancel-in-progress: true | |
| jobs: | |
| tangled-mirror: | |
| runs-on: ubuntu-slim | |
| env: | |
| TANGLED_REPO_URL: git@tangled.sh:solsticegamestudios.com/GModPatchTool | |
| TANGLED_SSH_KEY: ${{ secrets.TANGLED_SSH_KEY }} | |
| steps: | |
| #- name: Install Git | |
| # run: | | |
| # sudo apt install git git-lfs -y | |
| # git lfs install | |
| - name: Checkout Repo | |
| run: git clone --mirror $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git . | |
| - name: Add Tangled Remote | |
| run: git remote add tangled $TANGLED_REPO_URL | |
| - name: Decode SSH key | |
| run: | | |
| echo $TANGLED_SSH_KEY | base64 --decode > "$RUNNER_TEMP/ssh.key" | |
| chmod 600 "$RUNNER_TEMP/ssh.key" | |
| - name: Setup SSH known_hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| sudo ssh-keyscan -t rsa tangled.sh >> ~/.ssh/known_hosts | |
| sudo chmod 700 ~/.ssh | |
| sudo chmod 644 ~/.ssh/known_hosts | |
| sudo chown -R runner:runner ~/.ssh | |
| - name: Push Repo to Mirror | |
| run: | | |
| eval `ssh-agent` | |
| ssh-add "$RUNNER_TEMP/ssh.key" | |
| git push --mirror --force tangled | |
| - name: Cleanup | |
| run: rm "$RUNNER_TEMP/ssh.key" |