Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to main branch #408

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Delivery & Release (Docker Build, Tag & Push)

on:
push:
branches: [master]
branches: [main]
release:
types: [released]

Expand All @@ -19,7 +19,7 @@ jobs:
run: |
export CI_COMMIT_SHORT_SHA=$(git describe --abbrev=7 --always --tags)
echo $CI_COMMIT_SHORT_SHA;
if [ ${GITHUB_REF##*/} = "master" ]; then
if [ ${GITHUB_REF##*/} = "main" ]; then
echo "::set-output name=tag::stg-$CI_COMMIT_SHORT_SHA-$(date +%F.%H%M%S)"
else
echo "::set-output name=tag::$CI_COMMIT_SHORT_SHA"
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
uses: aws-actions/amazon-ecr-login@v1
- name: Build and Push Stage Image to ECR
id: build-push
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: moderator
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
build-image:
needs: flake8
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
if: github.ref != 'refs/heads/main'
steps:
- name: Echo tag
id: echotag
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Finally use [gulp](http://gulpjs.com/) to check in all main static files and run

This application is currently run through integration and deploy pipelines via both [GitHub Actions](https://github.com/mozilla/mozmoderator/actions/workflows/ci.yaml) & a background Kubernetes [Flux](https://fluxcd.io/) setup leveraging [Helm Charts](github.com/mozilla-it/helm-charts/).

Through those workflows, a Docker image is built, tagged, pushed to ECR, and deployed either to a staging [(itse-apps-stage-1)](https://github.com/mozilla-it/itse-apps-stage-1-infra/) or production [(itse-apps-prod-1)](https://github.com/mozilla-it/itse-apps-prod-1-infra/) Kubernetes cluster.
Through those workflows, a Docker image is built, tagged, pushed to ECR, and deployed either to a staging [(itse-apps-stage-1)](https://github.com/mozilla-it/itse-apps-stage-1-infra/) or production [(itse-apps-prod-1)](https://github.com/mozilla-it/itse-apps-prod-1-infra/) Kubernetes cluster.

tl;dr: Push commits to master branch for a stage deploy, cut GitHub releases (following v1.2.3 format) for a production deploy.
tl;dr: Push commits to main branch for a stage deploy, cut GitHub releases (following v1.2.3 format) for a production deploy.

### The pipelines work as followed:

Expand All @@ -45,8 +45,8 @@ tl;dr: Push commits to master branch for a stage deploy, cut GitHub releases (fo
3. (automated) upon push (if a branch off this repository) or PR (both our repository & forks), GitHub Actions will:
- run linting & syntax checks on the code;
- build the Docker image & tag it with the short git commit SHA of the latest commit to confirm the image can be built;
4. (manual) create a PR from your feature branch to the master branch, have it reviewed, then merged into master;
5. (automated) Upon merge into master, GitHub Actions will:
4. (manual) create a PR from your feature branch to the main branch, have it reviewed, then merged into main;
5. (automated) Upon merge into main, GitHub Actions will:
- run linting & syntax checks on the code;
- build the Docker image & tag it with "stg-{the 7-digit short git commit SHA of the latest commit};
- push that Docker image & tag to our ECR repository for Moderator;
Expand All @@ -61,7 +61,7 @@ tl;dr: Push commits to master branch for a stage deploy, cut GitHub releases (fo
#### Production Deploy:

7. (manual) test / QA the stage deploy as desired (moderator.allizom.org).
8. (manual) Create a GitHub Release off of the master branch with appropriate semver updating (using the pattern `^(v[0-9]+.[0-9]+.[0-9]+)$`);
8. (manual) Create a GitHub Release off of the main branch with appropriate semver updating (using the pattern `^(v[0-9]+.[0-9]+.[0-9]+)$`);
9. (automated): upon Release, GitHub Actions will:
- run linting & syntax checks on the code;
- pull the docker image of the latest commit in that release & tag that image with the release version;
Expand Down
Loading