Skip to content

Commit

Permalink
chore: working secrets being setup properly
Browse files Browse the repository at this point in the history
  • Loading branch information
peeter-tomberg committed Aug 15, 2023
1 parent e5b634f commit 9ec879a
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 412 deletions.
46 changes: 45 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:

build-staging:
needs: prebuild
if: ${{ github.ref == 'refs/heads/develop' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prebuild.outputs.matrix) }}
steps:
- uses: "actions/checkout@v3"
Expand All @@ -39,6 +39,7 @@ jobs:

deploy-staging:
needs: build-staging
if: ${{ github.ref == 'refs/heads/develop' }}
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
Expand All @@ -55,3 +56,46 @@ jobs:
region: ${{ vars.FVST_PROJECT_REGION }}
prefix: ${{ vars.FVST_PROJECT_PREFIX }}
docker-tag: ${{ env.DOCKER_TAG }}

build-production:
needs: prebuild
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prebuild.outputs.matrix) }}
steps:
- uses: "actions/checkout@v3"
- name: "Configure env variables"
run: |
project="${{ vars.FVST_PROJECT_PREFIX }}-fvst-production"
registry="us-docker.pkg.dev/$project/registry"
echo "project=$project" >> $GITHUB_ENV
echo "registry=$registry" >> $GITHUB_ENV
- uses: ./.github/actions/build-docker-container
with:
google_cloud_token: ${{ secrets.GOOGLE_CLOUD_TOKEN_PRODUCTION }}
turborepo_cache_bucket: ${{ vars.FVST_PROJECT_TURBOREPO_BUCKET_PRODUCTION }}
registry: ${{ env.registry }}
service: ${{ matrix.service }}
dockerfile: ${{ matrix.dockerfile }}
tag: ${{ env.DOCKER_TAG }}

deploy-production:
needs: build-production
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"

- uses: ./.github/actions/setup-google-cloud-auth
id: "auth"
with:
google_cloud_token: ${{ secrets.GOOGLE_CLOUD_TOKEN_PRODUCTION }}

- uses: ./.github/actions/terraform-apply
with:
environment: "production"
terraform-bucket: ${{ vars.FVST_PROJECT_TF_STATE_BUCKET_PRODUCTION }}
region: ${{ vars.FVST_PROJECT_REGION }}
prefix: ${{ vars.FVST_PROJECT_PREFIX }}
docker-tag: ${{ env.DOCKER_TAG }}
4 changes: 1 addition & 3 deletions .github/workflows/initialize.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Initialize environment
name: Initialize environments
on: [workflow_dispatch]
env:
DOCKER_TAG: initialize-run-${{ github.run_number }}
Expand All @@ -17,7 +17,6 @@ jobs:
needs: prebuild
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prebuild.outputs.matrix) }}
steps:
- uses: "actions/checkout@v3"
Expand Down Expand Up @@ -59,7 +58,6 @@ jobs:
needs: prebuild
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prebuild.outputs.matrix) }}
steps:
- uses: "actions/checkout@v3"
Expand Down
221 changes: 0 additions & 221 deletions .github/workflows/main.yml

This file was deleted.

Loading

0 comments on commit 9ec879a

Please sign in to comment.