diff --git a/.github/workflows/cd-backend.yml b/.github/workflows/cd-backend.yml index 716377b..82b41bd 100644 --- a/.github/workflows/cd-backend.yml +++ b/.github/workflows/cd-backend.yml @@ -18,6 +18,13 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Prepare Frontend Env + env: + FRONTEND_ENV: ${{ secrets.FRONTEND_ENV }} + run: | + echo "$FRONTEND_ENV" > frontend.env + + - name: Get terraform-apply.yml Run ID id: get-run-id run: | @@ -71,5 +78,7 @@ jobs: username: ${{ vars.EC2_USER }} key: ${{ secrets.PRIVATE_KEY }} script: | + sudo chown -R root:root /home/ubuntu/*.env mv backend.env backend/.env + mv frontend.env frontend/.env docker compose up -d --no-deps --force-recreate backend db adminer \ No newline at end of file diff --git a/.github/workflows/cd-frontend.yml b/.github/workflows/cd-frontend.yml index 721e55b..9e707e4 100644 --- a/.github/workflows/cd-frontend.yml +++ b/.github/workflows/cd-frontend.yml @@ -33,6 +33,7 @@ jobs: key: ${{ secrets.SERVER_SSH_KEY }} source: "frontend.env, compose.yml" target: "~/" + overwrite: true - name: Use SSH Action uses: appleboy/ssh-action@v1.2.0