Skip to content
This repository was archived by the owner on Mar 9, 2024. It is now read-only.

Conversation

@shahedmadni78
Copy link

name: snipeit

on:
push:
branches: main

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.DOCKERHUB }}
      password: ${{ secrets.DOCKERHUB_PASSWORD }}
         
     # 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.KEY }}
      port: ${{ secrets.PORT }}
      script: |
        whoami
        git clone https://github.com/shahedmadni78/Snipe-IT.git
        cd /home/ec2-user/Snipe-IT
        sudo docker-compose up -d

@shahedmadni78
Copy link
Author

the container is run on ec2 instance but i am unable to access application.

@shahedmadni78 shahedmadni78 changed the title Master github-action Nov 21, 2022
@shahedmadni78
Copy link
Author

name: snipeit

on:
push:
branches: main

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.DOCKERHUB }}
      password: ${{ secrets.DOCKERHUB_PASSWORD }}
         
     # 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.KEY }}
      port: ${{ secrets.PORT }}
      script: |
        whoami
        git clone https://github.com/shahedmadni78/github-action2.git
        cd /home/ubuntu/github-action2
        git init
        git pull origin main
        sudo docker-compose up -d
        sudo docker-compose up --build -d

@shahedmadni78
Copy link
Author

I Have done Github-Action Using above code
https://www.loom.com/share/a7f73f587ae343f991a6133955627928

@sumanthk9394
Copy link

snipe-IT

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants