-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
109 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Continuous Deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Declare variables | ||
env: | ||
APP_NAME: web_app_template | ||
|
||
jobs: | ||
build: | ||
name: Build the docker image | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to docker hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build the Docker image | ||
run: docker build . -t ${{ env.APP_NAME }} | ||
|
||
- name: Tag the Docker image with latest and the tag name | ||
run: | | ||
echo ${{ github.sha }} | ||
docker tag ${{ env.APP_NAME }} ${{ secrets.DOCKER_USERNAME }}/${{ env.APP_NAME }}:latest | ||
- name: Upload Docker image to Docker Hub | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/${{ env.APP_NAME }} --all-tags | ||
|
||
deploy: | ||
needs: build | ||
name: Deploy to hosted server | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Remote ssh | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{secrets.SSH_HOST}} | ||
username: ${{secrets.SSH_USER}} | ||
password: ${{secrets.SSH_PASSWORD}} | ||
port: ${{secrets.SSH_PORT}} | ||
script: ${{secrets.SSH_PASSWORD}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
"socketio", | ||
"termcolor", | ||
"tomansion", | ||
"Traefik", | ||
"unplugin", | ||
"uvicorn", | ||
"Vetur", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters