From bc10754f5e976816ec25bc64434b4ac22b1e83ef Mon Sep 17 00:00:00 2001 From: Pratik Borole Date: Sun, 19 May 2024 09:36:39 +0530 Subject: [PATCH] ci: remove dev branch --- .github/workflows/ci.yml | 18 +++++++++--------- README.md | 11 ++++------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a50ef4..5a36108 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: Test, Build, Publish, Release on: push: - branches: [main, dev] + branches: [main] pull_request: - branches: [main, dev] + branches: [main] jobs: test: @@ -55,10 +55,10 @@ jobs: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - # if branch is main, use prod else dev - BUILD_NAME: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }} - # if the event is push and (the branch is dev or the commit message starts with `bump:`), then upload the image - UPLOAD_IMAGE: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/dev' || startsWith(github.event.head_commit.message , 'bump:')) }} + # if branch is main, use prod + BUILD_NAME: ${{ github.ref == 'refs/heads/main' && 'prod' }} + # if the event is push and the commit message starts with `bump:`, upload the image + UPLOAD_IMAGE: ${{ github.event_name == 'push' && startsWith(github.event.head_commit.message , 'bump:') }} needs: test runs-on: ubuntu-latest permissions: @@ -99,7 +99,7 @@ jobs: echo $GITHUB_ENV # Log into a Docker registry - # The login is performed only if the event is push and (the branch is dev or the commit message starts with `bump:`) + # The login is performed only if the event is push and the commit message starts with `bump:` - name: Login into registry ${{ env.REGISTRY }} if: ${{ env.UPLOAD_IMAGE != 'false' }} uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 @@ -109,7 +109,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} # Extract metadata (tags, labels) for Docker - # Metadata is extracted only if the event is push and (the branch is dev or the commit message starts with `bump:`) + # Metadata is extracted only if the event is push and the commit message starts with `bump:` - name: Extract Docker metadata if: ${{ env.UPLOAD_IMAGE != 'false' }} id: meta @@ -126,7 +126,7 @@ jobs: org.opencontainers.image.version=${{ env.VERSION }} # Build and upload Docker image to GHCR with Buildx - # The image is uploaded only if the event is push and (the branch is dev or the commit message starts with `bump:`) + # The image is uploaded only if the event is push and the commit message starts with `bump:` - name: Build and push id: docker_build uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 diff --git a/README.md b/README.md index 6ca66c2..3574133 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ For other docker commands, see [useful_commands.md](./useful_commands.md). ### Contribution Guidelines -- ***NEVER MERGE YOUR OWN CODE; ALWAYS RAISE A PR AGAINST `dev`!*** +- ***NEVER MERGE YOUR OWN CODE; ALWAYS RAISE A PR AGAINST `main`!*** - Follow [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) when authoring commit messages. - **Always pull latest changes** - There are several developers working on this project. Always pull/pull-rebase the latest, as necessary, from the branch you intend to commit your changes to. @@ -151,18 +151,15 @@ For other docker commands, see [useful_commands.md](./useful_commands.md). - [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) (freemium) - [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph) (free) - **Branches**: - - `main` is the production mainline. - - `dev` is the development line (***default branch***). + - `main` is the production mainline (***default branch***). - **PR merge strategy on Github** - Code should flow in the following direction through branches: ``` - feature/bug fix -> dev -> main + feature/bug fix -> main ``` - We'll be keeping a linear commit history and so using a combination of `Rebase and merge` and `Squash and merge` merge strategies. - Use `Rebase and merge` as ***default*** to ensure all commits from the branch to be merged are brought in individually to the target branch. - - `Squash and merge` may be used ***ONLY*** when bringing in changes from a feature/bug fix branch into `dev`. - - To maintain linear commit history, ensure to use `push force` when: - - Bringing `dev` on the same commit as `main` (ie rebasing `dev` onto `main`). + - `Squash and merge` may be used ***ONLY*** when bringing in changes from a feature/bug fix branch into `main`. - [More information on git rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase). - [More information on PR merge strategies](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github). - **Jira issue linking**