Skip to content

Commit cb1b74e

Browse files
Sync to the reference site's main branch; promote by workflow
The reference site now deploys from a single `main` branch, with the target environment chosen by a marker in the commit message. Point the sync at that branch and label its commits for staging. Replace the production-branch copycat with a promote-only job. It copies no files: content reaches the site solely through `main`, so the two branches can no longer drift into different trees. Pushing this branch still publishes the product live, exactly as it does today. Also pin the copycat action to the commit that v3 resolves to, and drop the pull_request trigger, which only produced redundant syncs.
1 parent 4c6aba6 commit cb1b74e

2 files changed

Lines changed: 26 additions & 41 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
1-
# This is a basic workflow to help you get started with Actions
1+
name: SyncToReferenceSite
22

3-
name: CopyChangesToMainRepo
4-
5-
# Controls when the action will run.
3+
# Copies this repo's tree into reference.groupdocs.com at
4+
# content/sites/groupdocs/conversion/ on `main` — the site's single deploy branch.
5+
#
6+
# The commit message carries [deploy-qa], so the site deploys it to STAGING only
7+
# (reference2.groupdocs.com). To publish it live, run the PromoteToProduction workflow.
68
on:
7-
# Triggers the workflow on push or pull request events but only for the main branch
89
push:
910
branches: [ main ]
10-
pull_request:
11-
branches: [ main ]
12-
13-
# Allows you to run this workflow manually from the Actions tab
1411
workflow_dispatch:
1512

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1713
jobs:
18-
# This workflow contains a single job called "build"
1914
build:
20-
# The type of runner that the job will run on
2115
runs-on: ubuntu-latest
22-
23-
# Steps represent a sequence of tasks that will be executed as part of the job
2416
steps:
2517
- name: Copycat
26-
uses: andstor/copycat-action@v3
18+
uses: andstor/copycat-action@c2b0316e9ab883478a4a7d40a4fcb03d17f281aa # v3
2719
with:
2820
personal_token: ${{ secrets.REPO_TOKEN }}
2921
src_path: /.
22+
# ⚠️ The trailing slash is load-bearing. copycat empties `${DST_PATH%/*}`, which is
23+
# `.../conversion` only while the trailing slash is present — drop it and that becomes
24+
# `.../groupdocs`, wiping EVERY product's content from the site repo.
3025
dst_path: /content/sites/groupdocs/conversion/
3126
dst_owner: groupdocs
3227
dst_repo_name: reference.groupdocs.com
3328
dst_branch: main
3429
src_branch: main
3530
clean: true
31+
commit_message: 'Update file(s) from ${{ github.repository }} [deploy-qa]'

‎.github/workflows/production.yml‎

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
1-
# This is a basic workflow to help you get started with Actions
1+
name: PromoteToProduction
22

3-
name: CopyChangesToProductionRepo
4-
5-
# Controls when the action will run.
3+
# Publishes this product's API reference to the LIVE site (reference.groupdocs.com).
4+
#
5+
# Copies NO files. Content reaches the site only through `main` (see SyncToReferenceSite);
6+
# this just asks the site to deploy the conversion content currently on `main` to production.
7+
# That is what keeps the two branches from ever holding different trees.
68
on:
7-
# Triggers the workflow on push or pull request events but only for the main branch
89
push:
910
branches: [ production ]
10-
pull_request:
11-
branches: [ production ]
12-
13-
# Allows you to run this workflow manually from the Actions tab
1411
workflow_dispatch:
1512

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1713
jobs:
18-
# This workflow contains a single job called "build"
19-
build:
20-
# The type of runner that the job will run on
14+
promote:
2115
runs-on: ubuntu-latest
22-
23-
# Steps represent a sequence of tasks that will be executed as part of the job
2416
steps:
25-
- name: Copycat
26-
uses: andstor/copycat-action@v3
27-
with:
28-
personal_token: ${{ secrets.REPO_TOKEN }}
29-
src_path: /.
30-
dst_path: /content/sites/groupdocs/conversion/
31-
dst_owner: groupdocs
32-
dst_repo_name: reference.groupdocs.com
33-
dst_branch: production
34-
src_branch: production
35-
clean: true
17+
- name: Deploy the current site `main` content for conversion to production
18+
env:
19+
GH_TOKEN: ${{ secrets.REPO_TOKEN }}
20+
run: |
21+
gh workflow run deploy_conversion.yml \
22+
--repo groupdocs/reference.groupdocs.com \
23+
--ref main \
24+
-f environment=production

0 commit comments

Comments
 (0)