Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Andcool-Systems committed Sep 6, 2024
1 parent 93d7a2b commit 52ed9d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,15 @@ jobs:
- name: Set up OpenSSL
run: sudo apt-get install -y openssl

- name: Encrypt .env file
- name: Encrypt env file
run: |
openssl aes-256-cbc -salt -in ./production_build/.env -out .env.enc -k ${{ secrets.ENCRYPTION_KEY }}
openssl aes-256-cbc -salt -in ./production_build/env -out env.enc -k ${{ secrets.ENCRYPTION_KEY }}
- name: ls
run: ls production_build/

- name: Upload .env file
- name: Upload env file
uses: actions/upload-artifact@v4
with:
name: encrypted-env
path: .env.enc
path: env.enc

build:
runs-on: ubuntu-latest
Expand All @@ -68,15 +65,15 @@ jobs:
with:
node-version: "20"

- name: Download .env file
- name: Download env file
uses: actions/download-artifact@v4
with:
name: encrypted-env
path: .

- name: Decrypt .env file
- name: Decrypt env file
run: |
openssl aes-256-cbc -d -in .env.enc -out .env -k ${{ secrets.ENCRYPTION_KEY }}
openssl aes-256-cbc -d -in env.enc -out .env -k ${{ secrets.ENCRYPTION_KEY }}
- name: Install dependencies
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion production_build/construct_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
now = datetime.datetime.now(datetime.timezone(offset, name='МСК'))
formatted_date = now.strftime("%H:%M:%S %d.%m.%Y")

with open('production_build/.env', 'w') as env:
with open('production_build/env', 'w') as env:
env.write(f'NEXT_PUBLIC_API_URL={os.getenv("NEXT_PUBLIC_API_URL")}\n')
env.write(
f'NEXT_PUBLIC_GLOBAL_API_URL={os.getenv("NEXT_PUBLIC_GLOBAL_API_URL")}\n')
Expand Down

0 comments on commit 52ed9d4

Please sign in to comment.