-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from mpiorowski/feature/move-postgres
Added utils as the only service using postgres
- Loading branch information
Showing
121 changed files
with
9,937 additions
and
2,227 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Deploy Users Go | ||
|
||
on: | ||
push: | ||
branches: | ||
- release-users-go/** | ||
workflow_call: | ||
secrets: | ||
GCP_CREDENTIALS: | ||
required: true | ||
DATABASE_URL: | ||
required: true | ||
SENDGRID_API_KEY: | ||
required: true | ||
|
||
env: | ||
GAR_LOCATION: europe-north1 | ||
PROJECT_ID: rusve-384620 | ||
REPOSITORY: rusve-repo | ||
DATABASE: rusve-db | ||
SERVICE: users-go | ||
REGION: europe-north1 | ||
ENV: production | ||
BUCKET: rusve-bucket | ||
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }} | ||
DATABASE_URL: ${{ secrets.DATABASE_URL }}&dbname=users | ||
# DATABASE_URL=postgresql:///?dbname=${{ env.SERVICE }}&host=/cloudsql/${{ env.PROJECT_ID }}:${{ env.REGION }}:${{ env.DATABASE }}&user=postgres&password=${{ secrets.DB_PASS }} | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
lint: | ||
uses: ./.github/workflows/lint-users-go.yml | ||
deploy: | ||
needs: | ||
- lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Google Auth | ||
id: auth | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
credentials_json: "${{ secrets.GCP_CREDENTIALS }}" | ||
- name: Docker Auth | ||
id: docker-auth | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.GCP_CREDENTIALS }} | ||
- name: Build and Push Container | ||
run: |- | ||
docker build -f ./service-users-go/Dockerfile -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" ./service-users-go | ||
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" | ||
- name: Deploy to Cloud Run | ||
id: deploy | ||
uses: google-github-actions/deploy-cloudrun@v1 | ||
with: | ||
service: ${{ env.SERVICE }} | ||
region: ${{ env.REGION }} | ||
image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} | ||
env_vars: | | ||
ENV=${{ env.ENV }} | ||
DATABASE_URL=${{ env.DATABASE_URL }} | ||
SENDGRID_API_KEY=${{ env.SENDGRID_API_KEY }} | ||
BUCKET=${{ env.BUCKET }} | ||
- name: Show Output | ||
run: echo ${{ steps.deploy.outputs.url }} |
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,70 @@ | ||
name: Deploy Users Rust | ||
|
||
on: | ||
push: | ||
branches: | ||
- release-users-rust/** | ||
workflow_call: | ||
secrets: | ||
GCP_CREDENTIALS: | ||
required: true | ||
DATABASE_URL: | ||
required: true | ||
SENDGRID_API_KEY: | ||
required: true | ||
|
||
env: | ||
GAR_LOCATION: europe-north1 | ||
PROJECT_ID: rusve-384620 | ||
REPOSITORY: rusve-repo | ||
DATABASE: rusve-db | ||
SERVICE: users-rust | ||
REGION: europe-north1 | ||
ENV: production | ||
BUCKET: rusve-bucket | ||
DATABASE_URL: ${{ secrets.DATABASE_URL }}&dbname=users | ||
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }} | ||
# DATABASE_URL=postgresql:///?dbname=${{ env.SERVICE }}&host=/cloudsql/${{ env.PROJECT_ID }}:${{ env.REGION }}:${{ env.DATABASE }}&user=postgres&password=${{ secrets.DB_PASS }} | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
lint: | ||
uses: ./.github/workflows/lint-users-rust.yml | ||
deploy: | ||
needs: | ||
- lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Google Auth | ||
id: auth | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
credentials_json: "${{ secrets.GCP_CREDENTIALS }}" | ||
- name: Docker Auth | ||
id: docker-auth | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.GCP_CREDENTIALS }} | ||
- name: Build and Push Container | ||
run: |- | ||
docker build -f ./service-${{ env.SERVICE }}/Dockerfile -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" ./service-${{ env.SERVICE }} | ||
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" | ||
- name: Deploy to Cloud Run | ||
id: deploy | ||
uses: google-github-actions/deploy-cloudrun@v1 | ||
with: | ||
service: ${{ env.SERVICE }} | ||
region: ${{ env.REGION }} | ||
image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} | ||
env_vars: | | ||
ENV=${{ env.ENV }} | ||
DATABASE_URL=${{ env.DATABASE_URL }} | ||
- name: Show Output | ||
run: echo ${{ steps.deploy.outputs.url }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Lint Utils Go | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
cache: false | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
working-directory: ./service-utils-go | ||
args: --skip-dirs=proto --timeout=3m |
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,16 @@ | ||
name: Lint Utils Rust | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
RUSTFLAGS: "-Dwarnings" | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./service-utils-rust | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: RUSTFLAGS="--cfg uuid_unstable" cargo clippy |
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
Oops, something went wrong.