update docker #4
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
name: Build and Deploy App | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-project: | |
name: Build project | |
runs-on: self-hosted | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Create .env file | |
run: | | |
echo "AUTH_TRUST_HOST=TRUE" >> .env | |
- name: Build Docker image | |
run: | | |
docker build -t forzamods-dev . | |
- name: Deploy Docker container | |
if: success() | |
run: | | |
docker stop forzamods-dev || true | |
docker rm forzamods-dev || true | |
docker run -d -p 3271:3000 \ | |
--name forzamods-dev \ | |
--env-file .env \ | |
--restart unless-stopped \ | |
forzamods-dev | |
- name: Cleanup | |
run: | | |
rm .env |