Skip to content

Commit

Permalink
.github/workflows: add atlas ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
luantranminh committed Aug 29, 2024
1 parent 3a1c947 commit 41fa658
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci-atlas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Atlas
on:
push:
branches:
- master
paths:
- .github/workflows/ci-atlas.yaml
- '/*'
pull_request:
paths:
- '/*'
# Permissions to write comments on the pull request.
permissions:
contents: read
pull-requests: write
jobs:
atlas:
services:
# Spin up a postgres:15 container to be used as the dev-database for analysis.
postgres:
image: postgres:15
env:
POSTGRES_DB: dev
POSTGRES_PASSWORD: pass
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ariga/setup-atlas@v0
with:
cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN_W3KTO5 }}
- uses: ariga/atlas-action/schema/plan@v1
with:
dir: 'file://'
dir-name: 'app-test'
dev-url: 'postgres://postgres:pass@localhost:5432/dev?search_path=public&sslmode=disable'
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: ariga/atlas-action/shema/push@v1
if: github.ref == 'refs/heads/master'
with:
dir: 'file://'
dir-name: 'app-test'
dev-url: 'postgres://postgres:pass@localhost:5432/dev?search_path=public&sslmode=disable'

0 comments on commit 41fa658

Please sign in to comment.