Skip to content

Commit

Permalink
added ci/cd and fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Erjan Mukhamedjanov committed Sep 28, 2024
1 parent 10ada90 commit f7b8c92
Show file tree
Hide file tree
Showing 10 changed files with 949 additions and 15 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CD

on:
workflow_run:
workflows:
- "CI"
types:
- completed
branches:
- master

jobs:
push_container:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
docker build . --tag ghcr.io/${{ github.repository }}:${{ github.sha }}
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
deploy:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
needs: [push_container]
steps:
- name: Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
docker pull ghcr.io/${{ github.repository }}:${{ github.sha }}
docker stop vixorcypt
docker rm vixorcypt
docker run --name vixorcypt -p ${{ secrets.DOCKER_PORT }}:5173 \
--network custom-bridge \
--restart always -d ghcr.io/${{ github.repository }}:${{ github.sha }}
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on: push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Lint
run: |
npm install [email protected]
npx eslint . \
--config .eslint.config.js \
--ext .js
8 changes: 8 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import globals from "globals";
import pluginJs from "@eslint/js";


export default [
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
];
Loading

0 comments on commit f7b8c92

Please sign in to comment.