Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #2

Merged
merged 5 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/deploy.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "[DEV] - Deploy"

on:
pull_request:
branches:
- dev
types:
- closed
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: get-npm-version
id: package-version
run: |
echo "current-version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{secrets.GCP_DEV_CREDENTIALS}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GCR
uses: docker/login-action@v3
with:
registry: "us.gcr.io"
username: _json_key
password: ${{ secrets.GCP_DEV_CREDENTIALS }}
- name: Build and push
uses: docker/build-push-action@v6
id: docker_build
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
push: true
no-cache: false
provenance: false
tags: us.gcr.io/${{secrets.GCP_PROJECT_DEV}}/vial-dcs-backend/morphos:commit-${{ steps.package-version.outputs.current-version }}
- id: 'deploy'
uses: 'google-github-actions/deploy-cloudrun@v2'
with:
service: "morphos"
image: "${{fromJSON(steps.docker_build.outputs.metadata)['image.name']}}"
46 changes: 46 additions & 0 deletions .github/workflows/deploy.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "[PROD] - Deploy"

on:
pull_request:
branches:
- main
types:
- closed
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: get-npm-version
id: package-version
run: |
echo "current-version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{secrets.GCP_PROD_CREDENTIALS}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GCR
uses: docker/login-action@v3
with:
registry: "us.gcr.io"
username: _json_key
password: ${{ secrets.GCP_PROD_CREDENTIALS }}
- name: Build and push
uses: docker/build-push-action@v6
id: docker_build
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
push: true
no-cache: false
provenance: false
tags: us.gcr.io/${{secrets.GCP_PROJECT_PROD}}/vial-dcs-backend/morphos:commit-${{ steps.package-version.outputs.current-version }}
- id: 'deploy'
uses: 'google-github-actions/deploy-cloudrun@v2'
with:
service: "morphos"
image: "${{fromJSON(steps.docker_build.outputs.metadata)['image.name']}}"
46 changes: 46 additions & 0 deletions .github/workflows/deploy.stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "[STAGE] - Deploy"

on:
pull_request:
branches:
- stage
types:
- closed
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: get-npm-version
id: package-version
run: |
echo "current-version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{secrets.GCP_STAGING_CREDENTIALS}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GCR
uses: docker/login-action@v3
with:
registry: "us.gcr.io"
username: _json_key
password: ${{ secrets.GCP_STAGING_CREDENTIALS }}
- name: Build and push
uses: docker/build-push-action@v6
id: docker_build
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
push: true
no-cache: false
provenance: false
tags: us.gcr.io/${{secrets.GCP_PROJECT_STAGING}}/vial-dcs-backend/morphos:commit-${{ steps.package-version.outputs.current-version }}
- id: 'deploy'
uses: 'google-github-actions/deploy-cloudrun@v2'
with:
service: "morphos"
image: "${{fromJSON(steps.docker_build.outputs.metadata)['image.name']}}"
53 changes: 0 additions & 53 deletions .github/workflows/deploy_image.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN apt-get update \
COPY --from=builder /app/morphos /bin/morphos
COPY --from=builder /usr/share/fonts /usr/share/fonts

ENV FONTCONFIG_PATH /usr/share/fonts
ENV FONTCONFIG_PATH=/usr/share/fonts

# Use morphos as user
RUN useradd -m morphos
Expand Down