46 lines (40 loc) · 1.32 KB
/
deploy-approved.yaml
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
name: Deploy Approved
# Given a push to main, deploy new proposals to the site!
on:
push:
branches:
- main
paths:
- proposals/*.md
# CHANGE LABEL HERE TO CALL SOMETHING ELSE (e.g., incubating)
env:
approved_label: approved
jobs:
deploy-approved:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Find Changed or New Proposals
id: changed-files
uses: tj-actions/changed-files@32d6fb28f082f273420574e9de0a30be993bba58
with:
separator: " "
- name: Add approved files to site
id: added_updated_files
env:
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
run: python .github/scripts/deploy.py approved ${changed_files}
- name: Remove deleted proposals
id: removed_files
env:
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
run: python .github/scripts/deploy.py remove ${changed_files}
- name: Checkout New Branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
removed: ${{ steps.removed_files.outputs.removed }}
proposals: ${{ steps.added_updated_files.outputs.proposals }}
run: /bin/bash .github/scripts/deploy_approved.sh