Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mirror GitHub workflow #1734

Merged
merged 5 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [master, develop]
pull_request:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# If linting checks pass ok, push to the git.mysociety.org mirror
# Note: the git.mysociety.org repo pushes to this repo, and has priority.
# Force pushes will need to be made through other means.

name: Mirror to git.mysociety.org

on:
push:

jobs:

ci:
uses: ./.github/workflows/ci.yml

rubocop:
uses: ./.github/workflows/rubocop.yml

mirror:
needs: [ci, rubocop]
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'

- name: Push branch to git.mysociety.org
id: push_to_mirror
uses: mysociety/action-git-pusher@v1.1.1
with:
git_ssh_key: ${{ secrets.PUBLICCVS_GIT_KEY }}
ssh_known_hosts: ${{ secrets.GIT_KNOWN_HOSTS }}
tag: ${{ github.ref_name }}
remote: 'ssh://gh-public@git.mysociety.org/data/git/public/whatdotheyknow-theme.git'
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: RuboCop

on: [pull_request]
on: [pull_request, workflow_call]

permissions:
contents: read
Expand Down