From 7698e60d58f0930a6e0e033eb9d2fe2ea8bf709f Mon Sep 17 00:00:00 2001 From: Jimmy Debe <91767824+jimstir@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:41:58 -0400 Subject: [PATCH] RFC Website Workflow Sync (#27) A workflow to sync this repository with the rfc website. --- .github/workflows/website-sync.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 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 0000000..a172389 --- /dev/null +++ b/.github/workflows/website-sync.yml @@ -0,0 +1,41 @@ +name: Website Sync + +on: + pull_request: + types: [closed] + branches: + - main + +jobs: + sync: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Clone Website Repo + 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 Repo + run: | + for file in ${{ steps.changed_files.outputs.files }}; do + cp --parents "$file" rfc-website/ + done + + - name: Push changes to Website Repo + run: | + cd rfc-website + git add . + git commit -m "Sync website" + git push origin main