work on new ci
This commit is contained in:
parent
738b225f07
commit
eea9e81b23
|
@ -1,47 +1,37 @@
|
||||||
|
name: Deploy
|
||||||
name: CI
|
|
||||||
# TODO: use caching
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches:
|
||||||
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
new-deploy-account:
|
||||||
|
name: Deploy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
- uses: actions/checkout@v3
|
||||||
name: Checkout
|
- run: |
|
||||||
uses: actions/checkout@v2
|
npm install
|
||||||
-
|
npm run build
|
||||||
name: Login to Docker Hub
|
npm prune --production
|
||||||
uses: docker/login-action@v1
|
rm -rf .git
|
||||||
|
- name: copy tarball to server
|
||||||
|
uses: appleboy/scp-action@v0.1.4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
host: ${{ secrets.HOST }}
|
||||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
username: ${{ secrets.USERNAME }}
|
||||||
-
|
port: ${{ secrets.PORT }}
|
||||||
name: Set up Docker Buildx
|
key: ${{ secrets.KEY }}
|
||||||
uses: docker/setup-buildx-action@v1
|
source: "./*"
|
||||||
-
|
target: "."
|
||||||
name: Build and push
|
# - name: unpack tarball and restart app
|
||||||
uses: docker/build-push-action@v2
|
# uses: appleboy/ssh-action@v1.0.0
|
||||||
with:
|
# with:
|
||||||
context: .
|
# host: ${{ secrets.HOST }}
|
||||||
file: ./Dockerfile
|
# username: ${{ secrets.USERNAME }}
|
||||||
push: true
|
# key: ${{ secrets.KEY }}
|
||||||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/rtl-epub-maker:latest
|
# port: ${{ secrets.PORT }}
|
||||||
deploy:
|
# script:
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
# pm2 restart account
|
||||||
steps:
|
|
||||||
- name: executing remote ssh commands
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SERVER_DOMAIN_NAME }}
|
|
||||||
username: ${{ secrets.SERVER_USERNAME }}
|
|
||||||
key: ${{ secrets.SERVER_KEY }}
|
|
||||||
port: 22
|
|
||||||
script: |
|
|
||||||
cd repos/rtl-epub-maker &&
|
|
||||||
git pull &&
|
|
||||||
docker-compose pull &&
|
|
||||||
docker-compose up -d
|
|
||||||
docker image prune -af
|
|
||||||
|
|
Loading…
Reference in New Issue