Skip to content

Commit

Permalink
test build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriipavlov committed Mar 31, 2024
1 parent e08bb57 commit a5f521c
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/job-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache dependencies - restore
id: cache-deps-restore
uses: actions/cache/restore@v4
with:
path: |
vendor
/home/runner
key: build-cache-${{ inputs.SSH_HOST_ALIAS }}-${{ runner.os }}

- name: Prepare .env
run: |
bash ./sh/env/secret-gen.sh
Expand All @@ -43,23 +52,32 @@ jobs:
export CURRENT_GID=$(id -g)
bash ./sh/install.sh yes
- name: Save Built cache
uses: actions/cache@v4
- name: Cache dependencies - save
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
vendor
/home/runner
key: build-cache-${{ inputs.SSH_HOST_ALIAS }}-${{ runner.os }}

- name: Save Built job
uses: actions/cache/save@v4
with:
path: .
key: build-cache-${{ github.run_number }}
key: build-job-${{ github.run_number }}

deploy:
runs-on: ubuntu-22.04

needs: [ build ]

steps:
- name: Use Built cache
uses: actions/cache@v4
- name: Use Built job
uses: actions/cache/restore@v4
with:
path: .
key: build-cache-${{ github.run_number }}
key: build-job-${{ github.run_number }}

- name: Set up SSH key
run: |
Expand Down

0 comments on commit a5f521c

Please sign in to comment.