-
Notifications
You must be signed in to change notification settings - Fork 1
/
github-cms.template.yml
executable file
·89 lines (84 loc) · 3.38 KB
/
github-cms.template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: github-cms
on:
project_card:
types: [moved, converted, deleted]
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
# This is the source system repository
SRC_AUTH: ${{ secrets.GITHUB_TOKEN }}
SRC_OWNER: ${{ github.actor }}
SRC_REPO: ${{ github.event.repository.name }}
# This is the target system repository
TARGET_AUTH: ${{ secrets.GITHUB_TOKEN }}
TARGET_OWNER: ${{ github.actor }}
TARGET_REPO: ${{ github.event.repository.name }}
TARGET_ARCHIVE_PATH: "_archive"
# This is the metadata repository
META_AUTH: ${{ secrets.GITHUB_TOKEN }}
META_OWNER: ${{ github.actor }}
META_REPO: ${{ github.event.repository.name }}
META_PATH: ".meta/md"
# Collections and actions mapped to project columns
POSTS_PUBLISH_COLUMN: 5555555
POSTS_ARCHIVE_COLUMN: 3333333
PAGES_PUBLISH_COLUMN: 5555555
PAGES_ARCHIVE_COLUMN: 3333333
jobs:
publishing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: paulkoanui/github-cms-action@master
name: Publish Posts
if: |
github.event.project_card && github.event.project_card.content_url
&& (github.event.action == 'moved' || github.event.action == 'converted')
&& (github.event.project_card.column_id == env.POSTS_PUBLISH_COLUMN)
with:
action: "PUBLISH"
collection: "_posts"
- uses: paulkoanui/github-cms-action@master
name: Archive Posts
if: |
github.event.project_card && github.event.project_card.content_url
&& (github.event.action == 'moved' || github.event.action == 'converted')
&& (github.event.project_card.column_id == env.POSTS_ARCHIVE_COLUMN)
with:
action: "ARCHIVE"
collection: "_posts"
- uses: paulkoanui/github-cms-action@master
name: Unpublish Posts
if: |
github.event.project_card && github.event.project_card.content_url
&& github.event.action == 'deleted'
&& ((github.event.project_card.column_id == env.POSTS_PUBLISH_COLUMN) || (github.event.project_card.column_id == env.POSTS_ARCHIVE_COLUMN))
with:
action: "UNPUBLISH"
collection: "_posts"
- uses: paulkoanui/github-cms-action@master
name: Publish Pages
if: |
github.event.project_card && github.event.project_card.content_url
&& (github.event.action == 'moved' || github.event.action == 'converted')
&& (github.event.project_card.column_id == env.PAPGES_PUBLISH_COLUMN)
with:
action: "PUBLISH"
collection: "_pages"
- uses: paulkoanui/github-cms-action@master
name: Archive Pages
if: |
github.event.project_card && github.event.project_card.content_url
&& (github.event.action == 'moved' || github.event.action == 'converted')
&& (github.event.project_card.column_id == env.PAGES_ARCHIVE_COLUMN)
with:
action: "ARCHIVE"
collection: "_pages"
- uses: paulkoanui/github-cms-action@master
name: Unpublish Pages
if: |
github.event.project_card && github.event.project_card.content_url
&& github.event.action == 'deleted'
&& ((github.event.project_card.column_id == env.PAGES_PUBLISH_COLUMN) || (github.event.project_card.column_id == env.PAGES_ARCHIVE_COLUMN))
with:
action: "UNPUBLISH"
collection: "_pages"