Skip to content

Commit

Permalink
🚀 feat(ci): husky 설정 , 도커 파일 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
ImNM committed Jul 16, 2022
1 parent 0f378cf commit 135fc25
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Docker
on:
push:
branches: [main]
# Publish semver tags as releases.
tags: ["v*.*.*"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: water0641/ticket-admin
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.prod
platforms: linux/amd64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
public
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-staged
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@
"redux-thunk": "^2.4.1",
"web-vitals": "^2.1.4"
},
"lint-staged": {
"**/*.{js,jsx,json,tsx}": [
"prettier --write"
]
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"prepare": "husky install",
"lint-staged": "lint-staged"
},
"eslintConfig": {
"extends": [
Expand All @@ -41,5 +48,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"husky": "^8.0.1"
}
}
8 changes: 4 additions & 4 deletions src/components/AuthPage/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { slackValidation, slackMessage } from "../../state/actions-creators";
function LoginPage() {
const dispatch = useDispatch();

const { error } = useSelector((state) => state.slackMessage);
// const { adminValidationToken } = useSelector(
// (state) => state.slackValidation
// );
const { tickets, error, pending } = useSelector(
(state) => state.slackMessage
);

const [phoneNumber, setPhoneNumber] = useState("");
const [slackEmail, setSlackEmail] = useState("");
const [validationNumber, setValidationNumber] = useState("");
Expand Down
7 changes: 7 additions & 0 deletions src/state/actions-creators/slackMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export const slackMessage =
phoneNumber,
slackEmail,
});
// const response = await axios.post(
// "https://api.gosrock.band/v1/auth/slack/send",
// {
// phoneNumber,
// slackEmail,
// }
// );

console.log(response);

Expand Down
2 changes: 1 addition & 1 deletion src/state/storeSetting.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const adminAccessToken = localStorage.getItem("accessToken");
console.log(adminAccessToken);
// axios Bearer 토큰에 커먼 헤더로 껴놓기 위함
let authenticated = false;
if (adminAccessToken !== null && !adminAccessToken.length) {
if (adminAccessToken && adminAccessToken.length) {
authenticated = true;
axios.defaults.headers.common.Authorization = `Bearer ${adminAccessToken}`;
}
Expand Down

0 comments on commit 135fc25

Please sign in to comment.