-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.23 KB
/
publish-files.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
name: Publish Files
on:
push:
branches:
- main
workflow_dispatch:
jobs:
changed_files:
runs-on: ubuntu-latest
name: Test changed-files
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
separator: ","
files: |
modules/**/*.json
providers/**/*.json
- name: Install Go
uses: actions/setup-go@v4
if: steps.changed-files.outputs.any_changed == 'true'
- name: Created files
run: go run ./cmd/main.go publish ${{ steps.changed-files.outputs.all_changed_files }}
if: steps.changed-files.outputs.any_changed == 'true'
- name: Publish Changes
uses: s0/git-publish-subdir-action@develop
if: steps.changed-files.outputs.any_changed == 'true'
env:
REPO: self
BRANCH: host
FOLDER: dist
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLEAR_GLOBS_FILE: ".clear-target-files" # Points to an empty file, to not clear any file from the host branch