auto deploy

This commit is contained in:
Stanislaw
2022-06-20 20:42:28 +02:00
parent a81ba1d5b9
commit a4e3f6f025
3 changed files with 26 additions and 0 deletions

21
.github/workflows/deploy.yaml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Deploy
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker build -t ${{ github.repository }} .
- name: Deploy image
run: |
docker stop ${{ github.event.repository.name }} || true
docker rm ${{ github.event.repository.name }} || true
docker run -d -e ${{ github.repository }}

5
Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM node:16.10.0
WORKDIR /app
COPY ./ ./
RUN npm install
CMD ["npm", "run", "build"]

0
pages/login.js Normal file
View File