Skip to content

Commit

Permalink
fix tg login (#166)
Browse files Browse the repository at this point in the history
* Fix Tg auth
* Update workflow.yml
* Update React version
* Update dockerfile
  • Loading branch information
ernado-x authored Jan 15, 2022
1 parent 22c1bf9 commit fe0a8a1
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 81 deletions.
33 changes: 33 additions & 0 deletions .dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# pull official base image
FROM node:16.13.2-buster-slim AS builder

# set working directory
WORKDIR /app


# install app dependencies
#copies package.json and package-lock.json to Docker environment
COPY package.json ./

# Installs all node packages
RUN npm install


# Copies everything over to Docker environment
COPY . ./
RUN npm run build

#Stage 2
#######################################
#pull the official nginx:1.19.0 base image
FROM nginx:1.19.0
#copies React to the container directory
# Set working directory to nginx resources directory
WORKDIR /usr/share/nginx/html
# Remove default nginx static resources
RUN rm -rf ./*
# Copies static resources from builder stage
COPY --from=builder /app/build .
COPY ./default.conf /etc/nginx/conf.d/default.conf
# Containers run nginx with global directives and daemon off
ENTRYPOINT ["nginx", "-g", "daemon off;"]
27 changes: 19 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
logout: true

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Checkout
uses: actions/[email protected]
with:
node-version: 10.x
repository: ${{ github.repository }}

- name: Build and Publish
run: |
chmod +x ./docker/build.sh
./docker/build.sh ${{ secrets.GH_USERNAME }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.DOCKER_HUB_USERNAME }} ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build Docker image
run: |
now=$(date +%Y%m%d%H%M%S)
tag1="kpiua/ecampus-kpi-ua:$now"
tag2="kpiua/ecampus-kpi-ua:latest"
docker build ./ --file ./.dockerfile --tag $tag1 --tag $tag2
docker push $tag1
docker push $tag2
5 changes: 0 additions & 5 deletions docker/.dockerfile

This file was deleted.

64 changes: 0 additions & 64 deletions docker/build.sh

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"bootstrap": "^4.3.1",
"npm": "^6.14.8",
"prettier": "^2.0.5",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-router-dom": "5.3.0",
"react-google-recaptcha": "^2.0.1",
"react-js-pagination": "^3.0.2",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.3",
"reactstrap": "^8.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/AuthContainerDefault.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const AuthContainerDefault = () => {
setAuthFail(!user);

if (!!user) {
this.props.history.push(`/home`);
history.push(`/home`);
window.location.reload();
}
};
Expand Down

0 comments on commit fe0a8a1

Please sign in to comment.