From 872c8c1fc065c006c9a892f100d40becd6c2f23f Mon Sep 17 00:00:00 2001 From: prasadad99 <117622961+prasadad99@users.noreply.github.com> Date: Tue, 22 Nov 2022 13:21:34 +0530 Subject: [PATCH] github.yml --- github.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 github.yml diff --git a/github.yml b/github.yml new file mode 100644 index 000000000..84fee58b1 --- /dev/null +++ b/github.yml @@ -0,0 +1,46 @@ +name: snipeit + +on: + push: + branches: devcontainer + +jobs: + deploy: + + runs-on: ubuntu-latest + + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to GitHub Container Registry + uses: ./ + with: + registry: ghcr.io + username: ${{ secrets.GHCR_USER }} + password: ${{ secrets.GHCR_PASS }} + + - name: Checkout + uses: actions/checkout@v3 + + - name: log in dockerhub + uses: ./ + with: + username: ${{ secrets.DOCKERUSER }} + password: ${{ secrets.DOCKERHUB_PASS }} + # Runs a set of commands using the runners shell + - name: executing remote ssh commands using ssh key + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USER }} + key: ${{ secrets.PRIVATEKEY }} + port: ${{ secrets.PORT }} + + script: | + pwd + git clone https://github.com/kesarivamshi/Snipe-IT.git + cd /home/ubuntu/Snipe-IT + git pull origin main + sudo docker compose up --build -d