From 236eb3bf2dd82609d066cb2a33a0a33e1a471f66 Mon Sep 17 00:00:00 2001 From: Jimmy Debe <91767824+jimstir@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:07:21 -0400 Subject: [PATCH 1/2] Create website-sync.yml --- .github/workflows/website-sync.yml | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/website-sync.yml diff --git a/.github/workflows/website-sync.yml b/.github/workflows/website-sync.yml new file mode 100644 index 000000000..eabf4424c --- /dev/null +++ b/.github/workflows/website-sync.yml @@ -0,0 +1,43 @@ +name: Website Sync + +on: + pull_request: + types: [closed] + branches: + - main + actions: + - closed + +jobs: + sync: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Clone Repository B + run: | + git clone git@github.com:vacp2p/rfc-website.git + cd rfc-website + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + + - name: List of changed files + id: changed_files + run: | + echo "::set-output name=files::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})" + + - name: Copy changed files to Website + run: | + for file in ${{ steps.changed_files.outputs.files }}; do + cp --parents "$file" rfc-website/ + done + + - name: Push changes to Repository B + run: | + cd rfc-website + git add . + git commit -m "Sync website" + git push origin main From 63aefc865562be563c96ac09a8dff30c8ed7e8af Mon Sep 17 00:00:00 2001 From: Jimmy Debe <91767824+jimstir@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:23:36 -0400 Subject: [PATCH 2/2] Update website-sync.yml --- .github/workflows/website-sync.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/website-sync.yml b/.github/workflows/website-sync.yml index eabf4424c..a1723897b 100644 --- a/.github/workflows/website-sync.yml +++ b/.github/workflows/website-sync.yml @@ -5,8 +5,6 @@ on: types: [closed] branches: - main - actions: - - closed jobs: sync: @@ -17,7 +15,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Clone Repository B + - name: Clone Website Repo run: | git clone git@github.com:vacp2p/rfc-website.git cd rfc-website @@ -29,13 +27,13 @@ jobs: run: | echo "::set-output name=files::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})" - - name: Copy changed files to Website + - name: Copy changed files to Website Repo run: | for file in ${{ steps.changed_files.outputs.files }}; do cp --parents "$file" rfc-website/ done - - name: Push changes to Repository B + - name: Push changes to Website Repo run: | cd rfc-website git add .