Skip to content

Commit

Permalink
WIP: add composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
beuluis committed Dec 17, 2024
1 parent 78f0387 commit 0cd2878
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/actions/bun-environment-setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: 'Bun Environment Setup'

Check warning on line 1 in .github/actions/bun-environment-setup/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

1:1 [document-start] missing document start "---"
description: 'Setup bun and install dependencies'

# TODO: add build action with cache
inputs:
dependencies_type:
description: 'Dependencies type to install. Can be "production" or "development"'
Expand All @@ -25,19 +26,19 @@ runs:

- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
id: restore-dependencies-cache
with:
path: node_modules
key: dependencies-${{ runner.os }}-${{ hashFiles('**/bun.lockb') }}

- name: Install bun dependencies
if: steps.cache.outputs.cache-hit != 'true'
if: steps.restore-dependencies-cache.outputs.cache-hit != 'true'
shell: bash
run: bun install --frozen-lockfile ${{ inputs.dependencies_type == 'production' && '--production' || '' }}

- name: Cache dependencies
uses: actions/cache@v4
if: steps.cache.outputs.cache-hit != 'true'
if: steps.restore-dependencies-cache.outputs.cache-hit != 'true'
with:
path: node_modules
key: dependencies-${{ runner.os }}-${{ hashFiles('**/bun.lockb') }}
6 changes: 3 additions & 3 deletions .github/actions/npm-environment-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ runs:

- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
id: restore-dependencies-cache
with:
path: node_modules
key: dependencies-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install npm dependencies
if: steps.cache.outputs.cache-hit != 'true'
if: steps.restore-dependencies-cache.outputs.cache-hit != 'true'
shell: bash
run: npm ci ${{ inputs.dependencies_type == 'production' && '--omit=dev' || '' }}

- name: Cache dependencies
uses: actions/cache@v4
if: steps.cache.outputs.cache-hit != 'true'
if: steps.restore-dependencies-cache.outputs.cache-hit != 'true'
with:
path: node_modules
key: dependencies-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
2 changes: 1 addition & 1 deletion .github/actions/upload-to-s3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
if: inputs.endpoint_url != ''
shell: bash
run: |
aws configure set s3.endpoint_url ${{ inputs.endpoint_url }}
aws configure set endpoint_url ${{ inputs.endpoint_url }}
- name: Deploy to S3
shell: bash
Expand Down

0 comments on commit 0cd2878

Please sign in to comment.