-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
33 additions
and
3 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build and publish Docker image | ||
name: Build and publish Docker image, deploy | ||
|
||
on: | ||
push: | ||
|
@@ -45,3 +45,28 @@ jobs: | |
tags: ${{ steps.meta.outputs.tags }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build-and-push-image | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Prepare .env file for the deployment | ||
env: | ||
GF_SECURITY_ADMIN_PASSWORD: ${{ secrets.GF_SECURITY_ADMIN_PASSWORD }} | ||
GF_SECURITY_ADMIN_USER: ${{ secrets.GF_SECURITY_ADMIN_USER }} | ||
run: echo "DOMAIN=${{ secrets.DOMAIN }} \nGF_SECURITY_ADMIN_PASSWORD=$GF_SECURITY_ADMIN_PASSWORD \nGF_SECURITY_ADMIN_USER=$GF_SECURITY_ADMIN_USER" > .env | ||
- name: Remove existing containers | ||
uses: JimCronqvist/action-ssh@master | ||
with: | ||
hosts: ${{ secrets.SSH_HOST }} | ||
privateKey: ${{ secrets.PRIV_KEY }} | ||
command: docker rm -f turn grafana prometheus | ||
- name: Deploy docker compose to pre-configured server | ||
uses: TapTap21/[email protected] | ||
with: | ||
remote_docker_host: ${{ secrets.SSH_HOST }} | ||
ssh_private_key: ${{ secrets.PRIV_KEY }} | ||
ssh_public_key: ${{ secrets.PUB_KEY }} | ||
stack_file_name: docker-compose.yml | ||
args: -p turn --env-file .env -d --remove-orphans | ||
|
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