Skip to content

Commit

Permalink
General updates
Browse files Browse the repository at this point in the history
  • Loading branch information
loffa committed Apr 17, 2024
1 parent 965989d commit 97d7266
Show file tree
Hide file tree
Showing 13 changed files with 2,503 additions and 15,160 deletions.
53 changes: 31 additions & 22 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,41 @@ on:
push:
branches:
- master

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Build container
id: docker_build
uses: docker/build-push-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
load: true
tags: insektionen/kistan-doc:latest
- name: Export container
run: docker save insektionen/kistan-doc:latest | gzip > kistan-doc_latest.tar.gz
- name: Copy to Server
uses: appleboy/scp-action@master
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: 22
source: "kistan-doc_latest.tar.gz"
target: "~/"
- name: Import and start on Server
uses: appleboy/ssh-action@master
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build container
uses: docker/build-push-action@v5
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: 22
script: docker load < kistan-doc_latest.tar.gz && cd kistan-doc && docker-compose up -d
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# - name: Import and start on Server
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# port: 22
# script: cd kistan-doc && docker-compose up -d --pull
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ dist
.basement
config.local.js
basement_dist
src/.vuepress/.cache/
src/.vuepress/.temp/
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ COPY package.json package-lock.json /build/
COPY src/ /build/src
RUN npm install && npm run build

FROM node:lts-alpine
WORKDIR /app/
COPY --from=builder /build/package.json /build/package-lock.json /app/
COPY --from=builder /build/src/.vuepress/dist /app/src/.vuepress/dist
RUN npm install --production
EXPOSE 8080
CMD npm run serve
FROM nginx:stable-alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /build/src/.vuepress/dist /usr/share/nginx/html
Loading

0 comments on commit 97d7266

Please sign in to comment.