Skip to content

Commit

Permalink
only execute deploy action on push to dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
anayeaye committed Nov 6, 2024
1 parent dd0ea9e commit 8a3c584
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ permissions:
on:
push:
branches:
- main
- dev
- production
pull_request:
branches:
- main
Expand All @@ -36,12 +34,8 @@ jobs:
- name: Set the environment based on the branch
id: define_environment
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "env_name=staging" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/dev" ]; then
if [ "${{ github.ref }}" = "refs/heads/dev" ]; then
echo "env_name=development" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/production" ]; then
echo "env_name=production" >> $GITHUB_OUTPUT
fi
- name: Print the environment
run: echo "The environment is ${{ steps.define_environment.outputs.env_name }}"
Expand Down

0 comments on commit 8a3c584

Please sign in to comment.