From 42d5670fb7defa664d28fa5b830a479601e4576a Mon Sep 17 00:00:00 2001 From: Carlos Santiago <5726971+csantiago132@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:20:12 -0500 Subject: [PATCH] refactor(ci): new ci-cd proposal POC (#5) --- .github/workflows/branch.dev.yml | 11 ++++++++++ .github/workflows/{ci.yml => branch.main.yml} | 22 ++----------------- .github/workflows/branch.pr.yml | 14 ++++++++++++ 3 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/branch.dev.yml rename .github/workflows/{ci.yml => branch.main.yml} (55%) create mode 100644 .github/workflows/branch.pr.yml diff --git a/.github/workflows/branch.dev.yml b/.github/workflows/branch.dev.yml new file mode 100644 index 0000000..6a60011 --- /dev/null +++ b/.github/workflows/branch.dev.yml @@ -0,0 +1,11 @@ +name: CI/CD Dev Branch + +on: + push: + branches: + - dev + +jobs: + deploy: + uses: kurocado-studio/styleguide/.github/workflows/composite.deploy.yml@main + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/branch.main.yml similarity index 55% rename from .github/workflows/ci.yml rename to .github/workflows/branch.main.yml index f8b05d1..5b52696 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/branch.main.yml @@ -7,11 +7,9 @@ permissions: pull-requests: write on: - pull_request: push: branches: - main - - dev jobs: lint: @@ -32,24 +30,8 @@ jobs: needs: document uses: kurocado-studio/styleguide/.github/workflows/composite.release.yml@main secrets: inherit - if: | - github.event_name == 'push' && - github.ref == 'refs/heads/main' deploy: needs: release - name: Deploy app - runs-on: ubuntu-latest - concurrency: deploy-group - if: | - github.event_name == 'push' && - ( - github.ref == 'refs/heads/main' || - github.ref == 'refs/heads/dev' - ) - steps: - - uses: actions/checkout@v4 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + uses: kurocado-studio/styleguide/.github/workflows/composite.deploy.yml@main + secrets: inherit diff --git a/.github/workflows/branch.pr.yml b/.github/workflows/branch.pr.yml new file mode 100644 index 0000000..d4e8d55 --- /dev/null +++ b/.github/workflows/branch.pr.yml @@ -0,0 +1,14 @@ +name: CI/CD Pull Request + +on: + pull_request: + +jobs: + lint: + uses: kurocado-studio/styleguide/.github/workflows/composite.lint.yml@main + secrets: inherit + + test: + needs: lint + uses: kurocado-studio/styleguide/.github/workflows/composite.test.yml@main + secrets: inherit