Skip to content

Commit

Permalink
Some clean ups and typographical errors
Browse files Browse the repository at this point in the history
1. Some code had some staging logics, removed them
  • Loading branch information
maniankara authored and Anoop Vijayan Maniankara committed Nov 11, 2024
1 parent 49e8627 commit b8f2f0b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 32 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: Run tests and lint
run: make ci

# Deploys only to Prod, for PR workflow, refer ./pr.yaml
deploy:
runs-on: ubuntu-latest
# Run on main branch or release
Expand All @@ -43,17 +44,6 @@ jobs:
node-version: 20
- name: Install TailwindCSS
run: npm ci
- name: Write deploy variables
id: vars
run: |
if [ "${{ github.event_name }}" == "release" -o "${GITHUB_REF#refs/heads/}" == "main" ]
then
echo "DEPLOY_ENV=prod" >> $GITHUB_ENV
else
echo "DEPLOY_ENV=unknown" >> $GITHUB_ENV
fi
- name: Dump deployment variables
run: echo "DELPLOY_ENV=${DEPLOY_ENV}"
- uses: "google-github-actions/auth@v2"
with:
create_credentials_file: true
Expand All @@ -72,4 +62,4 @@ jobs:
gcloud auth configure-docker ${REGION}-docker.pkg.dev
- name: Build image and deploy
run: |
make deploy-${DEPLOY_ENV}
make deploy-prod
13 changes: 2 additions & 11 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ jobs:
GITHUB_PR: ${{ github.event.number }}
run: |
go run ./infra/cmd/preview/main.go -dry-run=false
- name: Write deploy variables
id: vars
run: |
if [ "${{ contains( github.event.pull_request.labels.*.name, 'preview') }}" == "true" ]
then
echo "DEPLOY_ENV=pr-${{ github.event.number }}" >> $GITHUB_ENV
else
echo "DEPLOY_ENV=unknown" >> $GITHUB_ENV
fi
- name: Dump deployment variables
run: echo "DELPLOY_ENV=${DEPLOY_ENV}"
- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -81,6 +70,8 @@ jobs:
gcloud auth configure-docker ${REGION}-docker.pkg.dev
- name: Build image and deploy
run: |
echo "DEPLOY_ENV=pr-${{ github.event.number }}" >> $GITHUB_ENV
echo "DEPLOY_ENV: ${{ github.event.number }}"
go run ./cmd/ci/ci.go -deploy=${DEPLOY_ENV}
destroy:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ ci: pr
preview:
$(CI_CMD) -preview

.PHONY: deploy-staging
deploy-staging:
$(CI_CMD) -deploy=staging

.PHONY: deploy-prod
deploy-prod:
$(CI_CMD) -deploy=prod
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ make pr

## Releasing

Pushing to the `main` branch deploys the changes to the staging environment <https://staging.verifa.io>
Tagging a `preview` to the pull request makes deploys it to the staging/PR environment <https://pr-xyx.verifa.io>

Tagging a version makes deploys it to the production environment <https://verifa.io>
Merging to the `main` branch deploys the changes to the production environment <https://verifa.io>

## Contributing

Expand Down
4 changes: 1 addition & 3 deletions cmd/ci/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func main() {
&deploy,
"deploy",
"",
"deploy the website to this env (staging or prod)",
"deploy the website to this env (pr env or prod)",
)
flag.BoolVar(&preview, "preview", false, "run a local preview environment")
flag.BoolVar(&pr, "pr", false, "run the pull request checks")
Expand Down Expand Up @@ -319,8 +319,6 @@ func HasGitDiff(ctx context.Context) {
func Deploy(ctx context.Context, deploy string) {
var cloudRunService string
switch deploy {
case "staging":
cloudRunService = cloudRunServiceStaging
case "prod":
cloudRunService = cloudRunServiceProd
default:
Expand Down

0 comments on commit b8f2f0b

Please sign in to comment.