forked from calcom/cal.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
58 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: "Set environment variables" | ||
description: "Configures environment variables for a workflow" | ||
inputs: | ||
DATABASE_URL: | ||
required: false | ||
default: "postgresql://postgres:@localhost:5432/calendso" | ||
path: | ||
required: false | ||
default: "backups/backup.sql" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create env file | ||
uses: actions/cache@v3 | ||
id: env-cache | ||
with: | ||
path: gh.env | ||
key: env-cache-${{ hashFiles('gh.env') }} | ||
restore-keys: env-cache- | ||
- name: Set Environment Variables | ||
uses: tw3lveparsecs/github-actions-setvars@latest | ||
with: | ||
envFilePath: gh.env | ||
- name: Cache database | ||
id: cache-db | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-db | ||
key-1: ${{ hashFiles('packages/prisma/schema.prisma', 'packages/prisma/migrations/**/**.sql', 'packages/prisma/*.ts') }} | ||
key-2: ${{ github.event.pull_request.number || github.ref }} | ||
with: | ||
path: ${{ inputs.path }} | ||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ env.key-1 }}-${{ env.key-2 }} | ||
- run: yarn db-seed | ||
if: steps.cache-db.outputs.cache-hit != 'true' | ||
shell: bash | ||
- name: Postgres Dump Backup | ||
if: steps.cache-db.outputs.cache-hit != 'true' | ||
uses: tj-actions/[email protected] | ||
with: | ||
database_url: ${{ inputs.DATABASE_URL }} | ||
path: ${{ inputs.path }} | ||
options: "-O" | ||
- name: Postgres Backup Restore | ||
if: steps.cache-db.outputs.cache-hit == 'true' | ||
uses: tj-actions/[email protected] | ||
with: | ||
database_url: ${{ inputs.DATABASE_URL }} | ||
backup_file: ${{ inputs.path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters