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

deploy.yaml outdated #4

Open
kitesurf opened this issue Mar 15, 2024 · 0 comments
Open

deploy.yaml outdated #4

kitesurf opened this issue Mar 15, 2024 · 0 comments

Comments

@kitesurf
Copy link

kitesurf commented Mar 15, 2024

The file deploy.yaml in folder .github/workflows/ need to be changed like following on step one.
Add the line from step two into the README.md

Step one: deploy.yaml
`name: Deploy Vendure
on:
push:
branches:
- develop
- main

env:
GCLOUD_PROJECT: your-own-project-id

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/[email protected]
with:
project_id: your-own-project-id
credentials_json: ${{ secrets.GCLOUD_DEVOPS_KEY }}
- uses: 'google-github-actions/setup-gcloud@v2'
with:
project_id: your-own-project-id
- name: Build Docker container
run: ./build-docker.sh your-own-project-id

deploy-production:
if: ${{ github.ref == 'refs/heads/main' }}
name: Deploying Prod ${{ matrix.instances.name }} with ${{ matrix.instances.secret }}
needs: [ build ]
strategy:
matrix:
instances: [
{ name: "your-own-project-id-api", db: "prod-db", secret: "ENV_PROD", memory: "2G"},
{ name: "your-own-project-id-worker", db: "prod-db", secret: "ENV_PROD", memory: "2G"},
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/[email protected]
with:
project_id: your-own-project-id
credentials_json: ${{ secrets.GCLOUD_DEVOPS_KEY }}
- uses: 'google-github-actions/setup-gcloud@v2'
with:
project_id: your-own-project-id
- run: 'echo "$SECRET_VARS" > .env'
env:
SECRET_VARS: ${{secrets[matrix.instances.secret]}}
- run: ./deploy.sh ${{ matrix.instances.name }} ${{ matrix.instances.db }} ${{ matrix.instances.memory }} your-own-project-id

deploy-test:
if: ${{ github.ref == 'refs/heads/develop' }}
name: Deploying Test ${{ matrix.instances.name }} with ${{ matrix.instances.secret }}
needs: [ build ]
strategy:
matrix:
instances: [
{ name: "your-own-project-id-test-api", db: "test-db", secret: "ENV_TEST", memory: "1G"},
{ name: "your-own-project-id-test-worker", db: "test-db", secret: "ENV_TEST", memory: "1G"},
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/[email protected]
with:
project_id: your-own-project-id
credentials_json: ${{ secrets.GCLOUD_DEVOPS_KEY }}
- uses: 'google-github-actions/setup-gcloud@v2'
with:
project_id: your-own-project-id
- run: 'echo "$SECRET_VARS" > .env'
env:
SECRET_VARS: ${{secrets[matrix.instances.secret]}}
- run: ./deploy.sh ${{ matrix.instances.name }} ${{ matrix.instances.db }} ${{ matrix.instances.memory }} your-own-project-id`

Step two: line 8 in README.md

The same is to do for the deploy.yaml file in the .github/workflows folder, here you'll need to change the 'your-own-project-id' with the correct project-id of your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant