Skip to content

Commit

Permalink
Merge pull request #51 from DesmondSanctity/event-badging-submit-api
Browse files Browse the repository at this point in the history
Event badging submit API
  • Loading branch information
adeyinkaoresanya authored Sep 27, 2024
2 parents 82cb3f1 + c9022d7 commit 3da16d0
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI/CD

on:
push:
branches:
- "staging"

env:
IMAGE_NAME: "project_badging_staging"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Remove old Docker images
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
if docker inspect ${{ env.IMAGE_NAME }} >/dev/null 2>&1; then
docker stop ${{ env.IMAGE_NAME }}
docker rm ${{ env.IMAGE_NAME }}
docker images --filter "reference=${{ env.IMAGE_NAME }}*" -q | xargs docker rmi -f || true
fi
- name: Build Docker image
run: docker build -t ${{ env.IMAGE_NAME }}:${{ github.sha }} .

- name: Create image archive
run: docker save ${{ env.IMAGE_NAME }}:${{ github.sha }} -o badging-staging.tar

- name: Upload image archive using appleboy/scp-action
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: badging.tar
target: ~/

- name: Extract and load image on droplet
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
docker load -i ~/badging-staging.tar
docker run -d \
-p ${{ secrets.PORT }}:${{ secrets.PORT }} \
--env-file /home/${{ secrets.USERNAME }}/staging/.env \
--network host \
--restart=always \
--name ${{ env.IMAGE_NAME }} \
${{ env.IMAGE_NAME }}:${{ github.sha }}
1 change: 1 addition & 0 deletions providers/github/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,6 @@ const githubAuthCallback = (app) => {
module.exports = {
githubAuth,
githubAuthCallback,
handleOAuthCallback,
githubApp,
};

0 comments on commit 3da16d0

Please sign in to comment.