professional-service/.github/workflows/github-mirror-ci.yaml
dependabot[bot] f3ade14698
chore(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-22 21:54:00 +00:00

55 lines
1.7 KiB
YAML

# Copyright 2026 Schwarz Digits Cloud GmbH & Co. KG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "Mirror to Public GitHub"
on:
push:
branches:
- main
jobs:
sync-to-github:
name: "Sync Repository"
if: github.server_url == 'https://professional-service.git.onstackit.cloud'
runs-on: "stackit-ubuntu-22"
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup SSH Key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- name: Push to Public Repo
run: |
echo "Setting up remote..."
git config --global user.name "ps-sync-bot"
git config --global user.email "ps-sync-bot@digits.schwarz"
# Add the GitHub remote using the SSH protocol
git remote add public git@github.com:stackitcloud/professional-service.git
echo "Pushing main branch to GitHub..."
git push public main --force
echo "Pushing tags to GitHub..."
git push public --tags --force