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

Mirroring action #6

Merged
merged 3 commits into from
Nov 1, 2024
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
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
python-version: '3.11'
- name: run ruff linter and formatter
run: |
pip install ruff==0.6.2
pip install ruff==0.6.2 djlint==1.35.4
ruff check .
ruff format . --check
ruff format . --check
djlint src/votes/templates --reformat --quiet
43 changes: 43 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Push mirror to git.mysociety.org

on:
push:
workflow_dispatch:
inputs:
force_push:
description: 'Force push branch'
type: boolean
required: false

jobs:
sync:
runs-on: ubuntu-latest

steps:

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

- name: Push branch to git.mysociety.org
id: push_to_mirror
if: ${{ github.event.inputs.force_push == 'false' || !github.event.inputs.force_push }}
uses: mysociety/[email protected]
with:
git_ssh_key: ${{ secrets.PUBLICCVS_GIT_KEY }}
ssh_known_hosts: ${{ secrets.GIT_KNOWN_HOSTS }}
tag: ${{ github.ref_name }}
remote: 'ssh://[email protected]/data/git/public/twfy-votes-django.git'


- name: Push branch to git.mysociety.org (force)
id: push_to_mirror_force
if: ${{ github.event.inputs.force_push == 'true' }}
uses: mysociety/[email protected]
with:
git_ssh_key: ${{ secrets.PUBLICCVS_GIT_KEY }}
ssh_known_hosts: ${{ secrets.GIT_KNOWN_HOSTS }}
tag: ${{ github.ref_name }}
remote: 'ssh://[email protected]/data/git/public/twfy-votes-django.git'
extra_git_config: --force
2 changes: 1 addition & 1 deletion script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ cd `dirname $0`/..

script/dev-command ruff check . --fix
script/dev-command ruff format .
djlint src/votes/templates --reformat --quiet
script/dev-command djlint src/votes/templates --reformat --quiet