chore: Update GitHub env caching to use current PR details (#10096)
parent
0bc7d4ceda
commit
df686370ab
|
@ -2,14 +2,16 @@ name: "Set environment variables"
|
||||||
description: "Configures environment variables for a workflow"
|
description: "Configures environment variables for a workflow"
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Create env file
|
- name: Read env file
|
||||||
uses: buildjet/cache@v3
|
uses: buildjet/cache@v3
|
||||||
id: env-cache
|
id: env-cache
|
||||||
with:
|
with:
|
||||||
path: gh.env
|
path: gh.env-${{ github.sha }}
|
||||||
key: env-cache-${{ hashFiles('gh.env') }}
|
key: env-cache
|
||||||
|
restore-keys: env-cache-
|
||||||
- name: Set Environment Variables
|
- name: Set Environment Variables
|
||||||
uses: tw3lveparsecs/github-actions-setvars@latest
|
uses: tw3lveparsecs/github-actions-setvars@latest
|
||||||
with:
|
with:
|
||||||
envFilePath: gh.env
|
envFilePath: gh.env-${{ github.sha }}
|
||||||
|
|
|
@ -4,6 +4,7 @@ on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
ENV_FILE_NAME: gh.env-${{ github.sha }}
|
||||||
INPUT_ENV_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
|
INPUT_ENV_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
|
||||||
INPUT_ENV_NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
|
INPUT_ENV_NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
|
||||||
INPUT_ENV_NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
|
INPUT_ENV_NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
|
||||||
|
@ -44,10 +45,11 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/dangerous-git-checkout
|
- uses: ./.github/actions/dangerous-git-checkout
|
||||||
- uses: ozaytsev86/create-env-file@v1
|
- uses: ozaytsev86/create-env-file@v1
|
||||||
|
|
||||||
with:
|
with:
|
||||||
file-name: ${{ github.workspace }}/gh.env
|
file-name: ${{ github.workspace }}/${{ env.ENV_FILE_NAME }}
|
||||||
- uses: buildjet/cache@v3
|
- uses: buildjet/cache@v3
|
||||||
id: env-cache
|
id: env-cache
|
||||||
with:
|
with:
|
||||||
path: gh.env
|
path: ${{ env.ENV_FILE_NAME }}
|
||||||
key: env-cache-${{ hashFiles('gh.env') }}
|
key: env-cache-${{ hashFiles(env.ENV_FILE_NAME) }}
|
||||||
|
|
Loading…
Reference in New Issue