-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init: created github actions for docker deploy * chore: added needs in push_to_registry * review: changed tsconfig and removed actions_init from actions --------- Co-authored-by: TakSeBiegam <[email protected]>
- Loading branch information
1 parent
00751da
commit 87ba98d
Showing
5 changed files
with
610 additions
and
565 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,6 @@ | ||
README.md | ||
.gitignore | ||
.git | ||
node_modules | ||
lib | ||
.github |
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,47 @@ | ||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: setup-node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.14 | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: install dependencies | ||
run: npm ci | ||
- name: check build errors | ||
run: npm run build | ||
- name: check test if exsists | ||
run: npm test --if-present | ||
push_to_registry: | ||
name: login, build and push docker image to docker hub | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: create tag | ||
run: echo "CURRENT_DATE=$(date +%s)" >> $GITHUB_ENV | ||
- name: Set env | ||
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ./Dockerfile | ||
context: . | ||
push: true | ||
tags: arkadiuszkurylo/aexol-shop-backend:${{ env.GITHUB_SHA_SHORT }}-${{ env.CURRENT_DATE }} |
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,8 @@ | ||
FROM node:18 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
RUN npm install | ||
COPY . . | ||
RUN npm run build |
Oops, something went wrong.