fix(workflow): properly added environment variables to deployment
This commit is contained in:
parent
19d6ac7f6e
commit
50256abceb
1 changed files with 6 additions and 12 deletions
|
|
@ -17,7 +17,6 @@ jobs:
|
||||||
- name: Login to Forgejo Container Registry
|
- name: Login to Forgejo Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
# NOTE: Used for Forgejo Runner variables
|
|
||||||
registry: ${{ vars.REGISTRY_DOMAIN }}
|
registry: ${{ vars.REGISTRY_DOMAIN }}
|
||||||
username: ${{ vars.REGISTRY_USER }}
|
username: ${{ vars.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
@ -49,8 +48,6 @@ jobs:
|
||||||
# ls -la
|
# ls -la
|
||||||
# echo "test"
|
# echo "test"
|
||||||
|
|
||||||
# Will probably SSH into docker instance
|
|
||||||
#
|
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
|
|
@ -58,7 +55,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Prerequisite, install node & docker
|
- name: Prerequisite, install node & docker
|
||||||
run: |
|
run: |
|
||||||
# Get Prerequisite Packages
|
|
||||||
unset HISTFILE
|
unset HISTFILE
|
||||||
apt update && apt install curl -y
|
apt update && apt install curl -y
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
|
||||||
|
|
@ -74,13 +70,6 @@ jobs:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Write secrets in an .env file
|
|
||||||
run: |
|
|
||||||
echo ${{ secrets.API_PORT }} >> .env
|
|
||||||
echo ${{ secrets.FRONTEND_PORT }} >> .env
|
|
||||||
echo ${{ secrets.AI_API_KEY }} >> .env
|
|
||||||
|
|
||||||
|
|
||||||
- name: Setup remote connection and deploy container.
|
- name: Setup remote connection and deploy container.
|
||||||
env:
|
env:
|
||||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||||
|
|
@ -98,6 +87,11 @@ jobs:
|
||||||
docker context create deploy --docker "host=ssh://deploy"
|
docker context create deploy --docker "host=ssh://deploy"
|
||||||
docker context use deploy
|
docker context use deploy
|
||||||
|
|
||||||
|
# Add secrets to the .env file
|
||||||
|
echo ${{ secrets.API_PORT }} >> .env
|
||||||
|
echo ${{ secrets.FRONTEND_PORT }} >> .env
|
||||||
|
echo ${{ secrets.AI_API_KEY }} >> .env
|
||||||
|
|
||||||
# Check to see if we have checked out the repo.
|
# Check to see if we have checked out the repo.
|
||||||
docker compose down
|
docker compose down
|
||||||
docker compose pull
|
docker compose pull
|
||||||
|
|
@ -107,5 +101,5 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
docker context use default
|
docker context use default
|
||||||
docker context rm deploy
|
docker context rm deploy
|
||||||
rm -rf ~/.ssh ~/.docker ~/.bash_history
|
rm -rf ~/.ssh ~/.docker ~/.bash_history .env
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue