Skip to content

Commit

Permalink
update script for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
foreverjun committed May 12, 2023
1 parent 3f3cb8c commit 27e7194
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/deploy_to_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,14 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
environment: deploy_environment
steps:
- name: Get current date
id: date
run: |
echo "date=$(date +'%Y-%m-%dT%H:%M:%S')" >> ${GITHUB_OUTPUT}
- name: Checkout
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/spbu-se/se_spbu_website
tags: |
latest
type=semver,pattern={{version}}
type=raw,value=${{steps.date.outputs.date}},enable=true
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Run deploy on server
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSHKEY }}
script: |
docker compose -f ./se_spbu_site/docker-compose.yml pull
docker compose -f ./se_spbu_site/docker-compose.yml up -d
docker image prune -f
script:
2 changes: 1 addition & 1 deletion src/run_uwsgi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask_se import app

if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)
app.run()

0 comments on commit 27e7194

Please sign in to comment.