From 4dc2b240d1cd51fbe54d3b76297dbbec681d3476 Mon Sep 17 00:00:00 2001 From: Pranav Kumar Mishra <62562712+pranavmishra90@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:20:18 -0600 Subject: [PATCH 1/2] fix: WIP temporarily pausing automatic github actions with selfhosted runner offline --- .github/workflows/build-and-push.yml | 18 +++++++++--------- .github/workflows/label-images-and-push.yml | 16 +++++++++------- .github/workflows/python-packages-label.yml | 6 +++--- .github/workflows/python-packages.yml | 6 +++--- .github/workflows/test-docker-images.yml | 15 ++++++++------- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 152e855..b2fe018 100755 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -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: diff --git a/.github/workflows/label-images-and-push.yml b/.github/workflows/label-images-and-push.yml index 5fab022..aa8876d 100755 --- a/.github/workflows/label-images-and-push.yml +++ b/.github/workflows/label-images-and-push.yml @@ -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 }} diff --git a/.github/workflows/python-packages-label.yml b/.github/workflows/python-packages-label.yml index 3eceb60..f0f5499 100644 --- a/.github/workflows/python-packages-label.yml +++ b/.github/workflows/python-packages-label.yml @@ -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] diff --git a/.github/workflows/python-packages.yml b/.github/workflows/python-packages.yml index 9544e3a..909b92c 100644 --- a/.github/workflows/python-packages.yml +++ b/.github/workflows/python-packages.yml @@ -1,9 +1,9 @@ name: Check Python Packages on: - push: - branches: - - main + # push: + # branches: + # - main workflow_dispatch: jobs: facsimilab-packages: diff --git a/.github/workflows/test-docker-images.yml b/.github/workflows/test-docker-images.yml index f83cb99..b8305a1 100755 --- a/.github/workflows/test-docker-images.yml +++ b/.github/workflows/test-docker-images.yml @@ -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 }} From cd2fa230f7cfebca77bd928338adfca8ad582710 Mon Sep 17 00:00:00 2001 From: Pranav Kumar Mishra <62562712+pranavmishra90@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:30:39 -0600 Subject: [PATCH 2/2] feat: add github action to update the develop branch when a new commit to main is made --- .github/workflows/merge-main-onto-develop.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/merge-main-onto-develop.yml diff --git a/.github/workflows/merge-main-onto-develop.yml b/.github/workflows/merge-main-onto-develop.yml new file mode 100644 index 0000000..84ba60d --- /dev/null +++ b/.github/workflows/merge-main-onto-develop.yml @@ -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/matrix-message-action@v0.0.3 + 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" \ No newline at end of file