Skip to content

Commit

Permalink
ci: merge two CI workflows into one
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed May 17, 2024
1 parent 5034429 commit b86a6e5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 83 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: Deploy to staging when pushing on staging
name: Build and deploy when pushing on staging or main

on:
push:
branches:
- main
- staging
- feat/github-ci

jobs:

deploy-staging:
build-deploy:

environment: staging

name: Deploy to staging from ${{ github.ref_name }}/${{ github.sha }}
name: Deploy from ${{ github.ref_name }}/${{ github.sha }}
environment: ${{ github.ref_name == 'main' && 'prod' || 'staging' }}

runs-on: ubuntu-latest

Expand All @@ -21,6 +22,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set environment for branch
run: |
if [[ $GITHUB_REF_NAME == 'main' ]]; then
echo "ENV=my-project-stg" >> "$GITHUB_ENV"
echo "EN=staging" >> "$GITHUB_ENV"
else
echo "GLCOUD_PROJECT=my-project-prd" >> "$GITHUB_ENV"
echo "VERCEL_TARGET=production" >> "$GITHUB_ENV"
fi
- name: Get current CI job ID
env:
GH_TOKEN: ${{ github.token }}
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/prod.yml

This file was deleted.

0 comments on commit b86a6e5

Please sign in to comment.