Skip to content

Commit

Permalink
fix: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
IraSkyx committed Oct 9, 2022
1 parent e30c98a commit 07d1252
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,26 @@ on:

jobs:
branch_check:
- name: Get environment from branch
id: branch_check
name: 'Check current branch to determine environment 👀'
runs-on: ubuntu-latest

steps:
- id: branch_check
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "::set-output name=env_name::production"
else
echo "::set-output name=env_name::staging"
echo "::set-output name=env_name::staging"
fi
outputs:
env_name: ${{ steps.branch_check.outputs.env_name }}
outputs:
env_name: ${{ steps.branch_check.outputs.env_name }}

release:
name: 'Build and push image 🔨🚀'
runs-on: ubuntu-latest
needs: branch_check
environment:
name: ${{ needs.build.outputs.env_name }}
name: ${{ needs.branch_check.outputs.env_name }}

steps:
- name: Checkout
Expand Down Expand Up @@ -60,6 +64,6 @@ jobs:
with:
context: .
push: true
tags: ghcr.io/bde-isima/${{ needs.build.outputs.env_name }}:latest
tags: ghcr.io/bde-isima/${{ needs.branch_check.outputs.env_name }}:latest
build-args: |
DATABASE_URL=${{ secrets.DATABASE_URL }}

0 comments on commit 07d1252

Please sign in to comment.