Skip to content

Commit

Permalink
feat: add github action to update the develop branch when a new commi…
Browse files Browse the repository at this point in the history
…t to main is made (#30)

Also pausing all other github actions until our self-hosted runner is
working again
  • Loading branch information
pranavmishra90 authored Nov 14, 2024
2 parents 5ad67bf + cd2fa23 commit 01d4b8c
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 29 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Build and Push Version

on:
push:
branches:
- main
pull_request:
types:
- opened
- assigned
paths:
- "docker/image_version.txt"
# push:
# branches:
# - main
# pull_request:
# types:
# - opened
# - assigned
# paths:
# - "docker/image_version.txt"
workflow_dispatch:

concurrency:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/label-images-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Label Images and Push

on:
workflow_run:
workflows: ["Test Docker Images"]
types:
- completed
workflow_dispatch:
push:
paths:
- .github/workflows/label-images-and-push.yml

# workflow_run:
# workflows: ["Test Docker Images"]
# types:
# - completed

# push:
# paths:
# - .github/workflows/label-images-and-push.yml

concurrency:
group: ${{ github.workflow }}
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/merge-main-onto-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Merge Main onto Develop

on:
push:
branches:
- main

permissions:
contents: write

jobs:
update-develop:
runs-on: ubuntu-latest

# This action should only run on the main repository, not forks
if: ${{ github.repository == 'FacsimiLab/facsimilab-platform' }} # Only run on main repository

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: true
set-safe-directory: '/'

- name: Read the image version
id: package
uses: juliangruber/read-file-action@v1
with:
path: ${{ github.workspace }}/docker/image_version.txt

- name: Merge Main onto Develop
run: |
git checkout develop
git merge main --no-edit
git push origin develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Matrix Message - Completed GitHub Action
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "FacsimiLab ${{ steps.package.outputs.content }} - Updated the `develop` branch from `main` at https://github.com/FacsimiLab/facsimilab-platform"
server: "matrix.drpranavmishra.com"
6 changes: 3 additions & 3 deletions .github/workflows/python-packages-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Check Python Packages - By Label

on:
workflow_dispatch:
push:
paths:
- "docker/image_version.txt"
# push:
# paths:
# - "docker/image_version.txt"
jobs:
facsimilab-packages:
runs-on: [self-hosted, linux, x64]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-packages.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Check Python Packages

on:
push:
branches:
- main
# push:
# branches:
# - main
workflow_dispatch:
jobs:
facsimilab-packages:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/test-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Test Docker Images

on:
workflow_run:
workflows: ["Build and Push Version"]
types:
- completed
workflow_dispatch:
push:
paths:
- .github/workflows/test-docker-images.yml

# workflow_run:
# workflows: ["Build and Push Version"]
# types:
# - completed
# push:
# paths:
# - .github/workflows/test-docker-images.yml

concurrency:
group: ${{ github.workflow }}
Expand Down

0 comments on commit 01d4b8c

Please sign in to comment.