Skip to content

Commit

Permalink
add cd
Browse files Browse the repository at this point in the history
  • Loading branch information
antonu17 committed Jan 21, 2025
1 parent c564756 commit 0b1bf45
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Deploy

on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
token:
required: true
jobs:
deploy:
runs-on: ubuntu-latest

steps:

- name: Perform Deployment
run: |
echo "Deploying to ${{inputs.environment}} ..."
echo "using token ${{secrets.token}}"
15 changes: 5 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,9 @@ jobs:
push-to-registry: true

deploy:
runs-on: ubuntu-latest
needs: ci-pipeline
if: github.ref == 'refs/heads/master'

steps:
- name: Trigger deployment pipeline
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
echo "Deploying to production environment..."
gh auth status
uses: ./.github/workflows/cd.yaml
with:
environment: production
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0b1bf45

Please sign in to comment.