forked from mathialm/secfit
-
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
1 changed file
with
45 additions
and
0 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,45 @@ | ||
| name: Deploy to development | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| deploy-dev: | ||
| runs-on: self-hosted # Ensure you're using your self-hosted runner | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 # Checkout the latest code | ||
|
|
||
| # Optionally, set environment variables (if needed) | ||
| - name: Set up environment variables | ||
| uses: falti/dotenv-action@v1.1.4 | ||
| with: | ||
| export-variables: true | ||
| keys-case: bypass | ||
|
|
||
| - name: Check environment variables | ||
| run: env | ||
|
|
||
| # Stop and remove existing Docker containers | ||
| - name: Stop and remove existing containers | ||
| run: | | ||
| sudo docker compose down || true | ||
| # Pull the latest Docker images (if using remote images) | ||
| - name: Pull latest Docker images | ||
| run: sudo docker compose pull || true | ||
|
|
||
| # Build Docker images if there are any changes | ||
| - name: Build Docker images | ||
| run: sudo docker compose build --no-cache | ||
|
|
||
| # Start Docker containers (detached mode) | ||
| - name: Start Docker containers | ||
| run: sudo docker compose up -d | ||
|
|
||
| # Verify that the containers are running | ||
| - name: Verify running Docker containers | ||
| run: sudo docker ps -a |