-
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
30 changed files
with
1,155 additions
and
707 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,57 @@ | ||
.gitname: Deploy on server | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# - name: Free Disk Space - Ubuntu Runners | ||
# uses: endersonmenezes/free-disk-space@v2 | ||
# with: | ||
# remove_android: true #64s~79s | ||
# remove_dotnet: true #1s-2s | ||
# remove_haskell: true #3s-5s | ||
# remove_tool_cache: true #4s-6s | ||
|
||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push Docker Image | ||
run: | | ||
docker buildx build --push --file Dockerfile --tag ghcr.io/rc1/high-or-low-game:latest . | ||
deploy: | ||
runs-on: self-hosted | ||
needs: build | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: Pull and Run Docker Image with Docker Compose | ||
run: | | ||
cd /home/ross/datadrive/docker-high-or-low-game/repo | ||
git pull origin main | ||
docker compose pull | ||
docker compose down | ||
docker compose up -d |
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,13 @@ | ||
# Step 1: Build the application | ||
FROM node:21.7.3 AS builder | ||
WORKDIR /app | ||
COPY package.json package-lock.json ./ | ||
RUN npm clean-install | ||
|
||
COPY . . | ||
RUN npm install | ||
RUN npm run build | ||
|
||
# Step 2: Set up the production environment | ||
FROM nginx | ||
COPY --from=builder /app/dist /usr/share/nginx/html |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: '3.8' | ||
|
||
services: | ||
sketchbook-js: | ||
image: ghcr.io/rc1/high-or-low-game:latest | ||
ports: | ||
- "8080:80" | ||
restart: always | ||
networks: | ||
- web | ||
labels: | ||
- traefik.http.routers.high-or-low-game.rule=Host(`high-or-low-game.electricglen.com`) | ||
- traefik.enable=true | ||
- traefik.http.routers.high-or-low-game.tls=true | ||
- traefik.http.routers.high-or-low-game.tls.certresolver=lets-encrypt | ||
- traefik.port=80 | ||
|
||
networks: | ||
web: | ||
external: true |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.