Skip to content

Commit

Permalink
deploy to digital ocean
Browse files Browse the repository at this point in the history
  • Loading branch information
walosha committed Feb 10, 2023
1 parent 17a381e commit 53e0794
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: churhc-dev
on:
push:
branches:
- develop
env:
SHA: ${{ github.sha }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Django app
uses: appleboy/ssh-action@v0.1.2
with:
host: ${{secrets.SSH_HOST}} # IP address of the server you wish to ssh into
key: ${{secrets.SSH_KEY}} # Private or public key of the server
username: ${{ secrets.SSH_USERNAME }} # User of the server you want to ssh into

script: |
mkdir app
cd app
git clone git@github.com:walosha/church_be.git
echo 'Deployment successful to digital ocean'
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///home/afuye/Desktop/playground/church/be/.github/workflows/deploy.yaml"
}
}
9 changes: 6 additions & 3 deletions church/event/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

SCOPES = ["https://www.googleapis.com/auth/calendar"]
service_account_email = os.getenv('GOOGLE_SERVICE_ACCOUNT')
credentials = service_account.Credentials.from_service_account_file('old.json')
credentials = service_account.Credentials.from_service_account_file('new.json')
scoped_credentials = credentials.with_scopes(SCOPES)
calendarId = os.getenv('CALENDER_ID')

Expand Down Expand Up @@ -79,7 +79,7 @@ def form_valid(self, request):
'timeZone': 'US/Central'
},
"start": {
'dateTime': '2023-01-25T17:00:00-07:00',
'dateTime': '2023-01-31T17:00:00-07:00',
'timeZone': 'US/Central'
},
"conferenceData": {
Expand All @@ -97,7 +97,10 @@ def form_valid(self, request):
# Implement worldwide delegation on admin account

# result = service.events().insert(conferenceDataVersion=1,calendarId=calendarId, body=event).execute()
result = service.events().insert(calendarId=calendarId, body=event).execute()
print("-------------------------------------------------")

result = service.events().insert( body=event).execute()
print("--------------------RESULT--------------------------")
return response.responses({"data":result.get('organizer'),"status":status.HTTP_201_CREATED})


Expand Down

0 comments on commit 53e0794

Please sign in to comment.