Skip to content

Commit

Permalink
Update mirror-to-codecommit.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
b88tneck authored Jan 31, 2024
1 parent dfc54b3 commit cd27e2c
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/mirror-to-codecommit.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
name: Mirror to AWS CodeCommit
name: Mirroring

on:
push:
branches:
- main # Replace with your main branch
on: [push, delete]

jobs:
mirror:
to_gitlab:
runs-on: ubuntu-latest
steps: # <-- must use actions/checkout before mirroring!
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
https://git-codecommit.eu-west-1.amazonaws.com/v1/repos/test-repo-backup
# ssh_private_key: # <-- use 'secrets' to pass credential information.
# ${{ secrets.GITLAB_SSH_PRIVATE_KEY }}

to_codecommit: # <-- different jobs are executed in parallel.
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v1
- uses: actions/checkout@v4
with:
aws-access-key-id: ${{ secrets.CODECOMMIT_SSH_PRIVATE_KEY_ID }}
aws-secret-access-key: ${{ secrets.CODECOMMIT_SSH_PUBLIC_KEY }}
aws-region: Ireland # Replace with your AWS region

- name: Mirror to AWS CodeCommit
run: |
git remote add aws-codecommit codecommit://Ireland://test-repo-backup
git push aws-codecommit --all
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
ssh://git-codecommit.eu-west-1.amazonaws.com/v1/repos/test-repo-backup
ssh_private_key:
${{ secrets.CODECOMMIT_SSH_PRIVATE_KEY }}
ssh_username: # <-- (for codecommit) you need to specify ssh-key-id as ssh username.
${{ secrets.CODECOMMIT_SSH_PRIVATE_KEY_ID }}

0 comments on commit cd27e2c

Please sign in to comment.