-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
976cdfa
commit 003a31e
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Title: Summary, imperative, start upper case, don't end with a period | ||
# No more than 50 chars. #### 50 chars is here: # | ||
|
||
# Remember blank line between title and body. | ||
|
||
# Body: Explain *what* and *why* (not *how*). Include task ID (Jira issue). | ||
# Wrap at 72 chars. ################################## which is here: # | ||
|
||
|
||
# At the end: Include Co-authored-by for all contributors. | ||
# Include at least one empty line before it. Format: | ||
# Co-authored-by: name <[email protected]> | ||
# | ||
# How to Write a Git Commit Message: | ||
# https://chris.beams.io/posts/git-commit/ | ||
# | ||
# 1. Separate subject from body with a blank line | ||
# 2. Limit the subject line to 50 characters | ||
# 3. Capitalize the subject line | ||
# 4. Do not end the subject line with a period | ||
# 5. Use the imperative mood in the subject line | ||
# 6. Wrap the body at 72 characters | ||
# 7. Use the body to explain what and why vs. how |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Run Tests and Create .env.development | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Create .env.development file | ||
env: | ||
PORT: ${{ secrets.PORT }} | ||
MONGODB_URI: ${{ secrets.MONGODB_URI }} | ||
NODE_ENV: development | ||
JWT_SECRET: ${{ secrets.JWT_SECRET }} | ||
ORIGIN: "*" | ||
run: | | ||
echo "PORT=${PORT}" >> .env.development | ||
echo "MONGODB_URI=${MONGODB_URI}" >> .env.development | ||
echo "NODE_ENV=${NODE_ENV}" >> .env.development | ||
echo "JWT_SECRET=${JWT_SECRET}" >> .env.development | ||
echo "ORIGIN=${ORIGIN}" >> .env.development | ||
- name: Run Jest tests | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Update docker dev image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Create .env.development file | ||
env: | ||
PORT: ${{ secrets.PORT }} | ||
MONGODB_URI: ${{ secrets.MONGODB_URI }} | ||
NODE_ENV: development | ||
JWT_SECRET: ${{ secrets.JWT_SECRET }} | ||
ORIGIN: "*" | ||
run: | | ||
echo "PORT=${PORT}" >> .env.development | ||
echo "MONGODB_URI=${MONGODB_URI}" >> .env.development | ||
echo "NODE_ENV=${NODE_ENV}" >> .env.development | ||
echo "JWT_SECRET=${JWT_SECRET}" >> .env.development | ||
echo "ORIGIN=${ORIGIN}" >> .env.development | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Build Docker image | ||
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/swifty-order-service . | ||
|
||
- name: Push Docker image | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/swifty-order-service |