Skip to content

Commit 5c3ce8a

Browse files
committed
ci: fix unicorn deployment
1 parent 6b141c7 commit 5c3ce8a

File tree

1 file changed

+4
-42
lines changed

1 file changed

+4
-42
lines changed

.github/workflows/deploy-unicorn.yml

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,22 @@ jobs:
88
changeDetection:
99
runs-on: ubuntu-latest
1010
outputs:
11-
hasChanges: ${{ steps.evaluation.outputs.hasChanges }}
11+
hasChanges: ${{ steps.changed-files.outputs.any_changed || 'true' }}
1212
steps:
1313
- uses: actions/checkout@v4
1414
with:
15-
ref: ${{ github.head_ref || github.ref }}
1615
fetch-depth: 0
1716

1817
- name: Inject slug/short variables
1918
uses: rlespinasse/github-slug-action@v4
2019

21-
# Cache handling to determine the last commit id of unicorn deployment
22-
# 1. Load cache file
23-
# 2. Read SHA from file
24-
# 3. Check if commit SHA has changed
25-
# 4. Update cache if necessary
26-
- name: Get last commit info file from cache
27-
id: sha-cache
28-
uses: actions/cache@v4
29-
with:
30-
path: last_commit_sha.txt
31-
key: last-commit-${{ env.GITHUB_REF_NAME_SLUG_URL }}-${{ github.run_id }}
32-
restore-keys: last-commit-${{ env.GITHUB_REF_NAME_SLUG_URL }}
33-
34-
- name: Read commit sha from file
35-
id: last-commit
36-
run: test -f last_commit_sha.txt
37-
&& echo "sha=$(cat last_commit_sha.txt)" >> $GITHUB_OUTPUT
38-
|| echo "sha=${{ github.event.pull_request.base.sha || github.event.before }}" >> $GITHUB_OUTPUT
39-
40-
- name: Save commit SHA to cache
41-
id: current-commit
42-
run: echo "${{ github.event.pull_request.head.sha || github.sha }}" > last_commit_sha.txt
43-
&& echo "sha=${{ github.event.pull_request.base.sha || github.sha }}" >> $GITHUB_OUTPUT
44-
4520
- name: Get changed files
46-
if: steps.current-commit.outputs.sha != steps.last-commit.outputs.sha
4721
id: changed-files
48-
uses: tj-actions/changed-files@v41
22+
uses: tj-actions/changed-files@v45
4923
with:
50-
sha: ${{ steps.current-commit.outputs.sha }}
51-
base_sha: ${{ steps.last-commit.outputs.sha }}
5224
files: |
53-
packages/elements
54-
packages/storybook
55-
56-
- name: Print all changed files
57-
if: steps.current-commit.outputs.sha != steps.last-commit.outputs.sha
58-
run: echo '${{ toJSON(steps.changed-files.outputs.all_changed_and_modified_files) }}'
59-
60-
- name: Check if storybook or elements was changed
61-
if: steps.changed-files.outputs.all_changed_and_modified_files != ''
62-
|| steps.current-commit.outputs.sha == steps.last-commit.outputs.sha
63-
id: evaluation
64-
run: echo "hasChanges=true" >> $GITHUB_OUTPUT
25+
packages/elements/**
26+
packages/storybook/**
6527
6628
deploy:
6729
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)