Skip to content

Commit

Permalink
Trigger deployment on push to main and release
Browse files Browse the repository at this point in the history
  • Loading branch information
alukach committed Jun 28, 2024
1 parent d9027d6 commit 88fbf5f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI/CD Workflow

on:
push:
release:
types:
- published

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Run tests
run: |
echo "TODO: Replace this with actual tests"
deploy-to-staging:
needs: test
if: github.ref_name == 'main'
concurrency: staging
uses: "./.github/workflows/deploy.yml"
with:
environment: staging
secrets: inherit

deploy-to-production:
needs: test
if: github.ref_name == 'production'
concurrency: production
uses: "./.github/workflows/deploy.yml"
with:
environment: production
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# A reusable workflow that deploys the contents of a repository to a target environment.
# https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow

name: Deploy
name: Deployment Workflow

permissions:
id-token: write
Expand Down

0 comments on commit 88fbf5f

Please sign in to comment.