-
-
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
Showing
6 changed files
with
69 additions
and
7 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,5 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
dist |
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 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Login Dockerhub | ||
env: | ||
DOCKER_USERNAME: ${{secrets.DOCKERHUB_USERNAME}} | ||
DOCKER_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}} | ||
|
||
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
- name: Build the Docker image | ||
run: docker build -t registar . | ||
- name: taging | ||
run: docker tag registar:latest jinseung0327/registar:latest | ||
- name: Push to Dockerhub | ||
run: docker push jinseung0327/registar:latest |
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,34 @@ | ||
name: CD Pipeline | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['Docker Image CI'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Pull Docker image | ||
run: sudo docker pull jinseung0327/registar:latest | ||
|
||
- name: Delete Old docker container | ||
run: sudo docker rm -f registar || true | ||
|
||
- name: Run Docker Container | ||
env: | ||
CLIENT_ID: ${{secrets.CLIENT_ID}} | ||
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}} | ||
ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}} | ||
ALLOWED_IP: ${{secrets.ALLOWED_IP}} | ||
SERVER_URL: ${{secrets.SERVER_URL}} | ||
run: | | ||
sudo docker run -d | ||
-e CLIENT_ID=$CLIENT_ID \ | ||
-e CLIENT_SECRET=$CLIENT_SECRET \ | ||
-e ACCESS_TOKEN=$ACCESS_TOKEN \ | ||
-e ALLOWED_IP=$ALLOWED_IP \ | ||
-e SERVER_URL=$SERVER_URL \ | ||
-p 3000:3000 --name registar jinseung0327/registar |
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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export default () => ({ | ||
CLIENT_ID: process.env.CLIENT_ID, | ||
GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET, | ||
GITHUB_ACCESS_TOKEN: process.env.GITHUB_ACCESS_TOKEN, | ||
GITHUB_ORG_NAME: process.env.GITHUB_ORG_NAME, | ||
CLIENT_SECRET: process.env.CLIENT_SECRET, | ||
ACCESS_TOKEN: process.env.ACCESS_TOKEN, | ||
ALLOWED_IP: process.env.ALLOWED_IP, | ||
SERVER_URL: process.env.SERVER_URL, | ||
}); |