atlashcl/gcp-secrets: example for working with gcp secrets from within github #1
Workflow file for this run
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
name: Atlas | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- .github/workflows/atlashcl-gcp-secrets.yaml | |
- 'atlashcl/gcp-secrets/migrations/*' | |
pull_request: | |
paths: | |
- 'atlashcl/gcp-secrets/migrations/*' | |
- .github/workflows/atlashcl-gcp-secrets.yaml | |
# Permissions to write comments on the pull request. | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
atlas: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- run: | | |
gcloud config get-value project | |
- uses: ariga/setup-atlas@v0 | |
- uses: ariga/atlas-action/migrate/lint@v1 | |
with: | |
dir: 'file://migrations' | |
dir-name: 'gcp-secrets' | |
dev-url: 'sqlite://dev?mode=memory' | |
config: file://atlas.hcl | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- uses: ariga/atlas-action/migrate/push@v1 | |
if: github.ref == 'refs/heads/master' | |
with: | |
dir: 'file://migrations' | |
dir-name: 'gcp-secrets' | |
dev-url: 'sqlite://dev?mode=memory' | |
config: file://atlas.hcl |