From da625967c32c9d661d6c4a3e9fbe9603cd5c2791 Mon Sep 17 00:00:00 2001 From: Ronen Lubin Date: Wed, 25 Sep 2024 14:30:05 +0300 Subject: [PATCH 1/3] doc/md: fix yml example in declarative push --- doc/md/declarative/plan.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/md/declarative/plan.mdx b/doc/md/declarative/plan.mdx index 5f6ecca0754..bf07f746c7e 100644 --- a/doc/md/declarative/plan.mdx +++ b/doc/md/declarative/plan.mdx @@ -503,7 +503,7 @@ on: branches: - master paths: - - .github/workflows/atlas-push.yaml + - .github/workflows/schema-push.yml - 'schema.sql' # Can be HCL, ORM, other instead. permissions: contents: read @@ -520,6 +520,7 @@ jobs: - uses: ariga/atlas-action/schema/push@master with: env: dev # Use the "dev" environment from the atlas.hcl file. + tag: latest # Optional, to tag the schema state (by default, it uses the git commit hash). ``` :::info ATLAS_TOKEN From 62de722963ebd9875eb9f3e01ba5245c7d01745f Mon Sep 17 00:00:00 2001 From: Ronen Lubin Date: Wed, 25 Sep 2024 15:45:13 +0300 Subject: [PATCH 2/3] fix schema plan file content --- doc/md/declarative/plan.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/md/declarative/plan.mdx b/doc/md/declarative/plan.mdx index bf07f746c7e..70f2b1ad9a8 100644 --- a/doc/md/declarative/plan.mdx +++ b/doc/md/declarative/plan.mdx @@ -544,13 +544,13 @@ on: branches: - master paths: - - .github/workflows/atlas-plan.yaml + - .github/workflows/schema-plan.yml - 'schema.sql' pull_request: branches: - master paths: - - .github/workflows/atlas-plan.yaml + - .github/workflows/schema-plan.yml - 'schema.sql' permissions: contents: read @@ -609,13 +609,13 @@ on: branches: - master paths: - - .github/workflows/atlas-schema.yaml + - .github/workflows/atlas-schema.yml - 'schema.sql' pull_request: branches: - master paths: - - .github/workflows/atlas-schema.yaml + - .github/workflows/atlas-schema.yml - 'schema.sql' permissions: contents: read From 96395818c099fba1dd611801468d744379563abb Mon Sep 17 00:00:00 2001 From: Ronen Lubin Date: Sun, 29 Sep 2024 14:51:10 +0300 Subject: [PATCH 3/3] yml to yaml --- doc/md/declarative/plan.mdx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/doc/md/declarative/plan.mdx b/doc/md/declarative/plan.mdx index 70f2b1ad9a8..f7f7e08eed8 100644 --- a/doc/md/declarative/plan.mdx +++ b/doc/md/declarative/plan.mdx @@ -496,14 +496,14 @@ https://.atlasgo.cloud/schemas/141733920769 In order to keep our schema repository up-to-date with the latest changes, we can set up the `schema/push` GitHub Action. This action automatically pushes the schema to the Atlas Registry whenever changes are made to the SQL schema file: -```yaml title=".github/workflows/schema-push.yml" +```yaml title=".github/workflows/schema-push.yaml" name: Push Declarative Schemas on: push: branches: - master paths: - - .github/workflows/schema-push.yml + - .github/workflows/schema-push.yaml - 'schema.sql' # Can be HCL, ORM, other instead. permissions: contents: read @@ -520,7 +520,6 @@ jobs: - uses: ariga/atlas-action/schema/push@master with: env: dev # Use the "dev" environment from the atlas.hcl file. - tag: latest # Optional, to tag the schema state (by default, it uses the git commit hash). ``` :::info ATLAS_TOKEN @@ -536,7 +535,7 @@ The last step is to set up the `schema/plan` and `schema/plan/approve` Actions: - `schema/plan/approve` - This action automatically approves the pending plan in the Atlas Registry after the PR is merged to the master branch. -```yaml title=".github/workflows/schema-plan.yml" +```yaml title=".github/workflows/schema-plan.yaml" name: Plan Declarative Migrations on: workflow_dispatch: @@ -544,13 +543,13 @@ on: branches: - master paths: - - .github/workflows/schema-plan.yml + - .github/workflows/schema-plan.yaml - 'schema.sql' pull_request: branches: - master paths: - - .github/workflows/schema-plan.yml + - .github/workflows/schema-plan.yaml - 'schema.sql' permissions: contents: read @@ -601,7 +600,7 @@ jobs: To avoid a race condition between the `push` and `plan` workflows, we can merge them into a single workflow. -```yaml title=".github/workflows/atlas-schema.yml" +```yaml title=".github/workflows/atlas-schema.yaml" name: Plan Declarative Migrations on: workflow_dispatch: @@ -609,13 +608,13 @@ on: branches: - master paths: - - .github/workflows/atlas-schema.yml + - .github/workflows/atlas-schema.yaml - 'schema.sql' pull_request: branches: - master paths: - - .github/workflows/atlas-schema.yml + - .github/workflows/atlas-schema.yaml - 'schema.sql' permissions: contents: read