x #161
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: Docker Prod | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: self-hosted | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create env file (SERVER) | |
run: | | |
touch .env | |
echo HOST=${{ secrets.HOST }} > .env | |
echo PORT=${{ secrets.PORT }} >> .env | |
echo SALT=${{ secrets.SALT }} >> .env | |
echo SECRET=${{ secrets.SECRET }} >> .env | |
echo SMTP_HOST=${{ secrets.SMTP_HOST }} >> .env | |
echo SMTP_PORT=${{ secrets.SMTP_PORT }} >> .env | |
echo SMTP_USER=${{ secrets.SMTP_USER }} >> .env | |
echo SMTP_PASS=${{ secrets.SMTP_PASS }} >> .env | |
cat .env | |
- name: Copy env to Server | |
run: mv .env ./server | |
- name: Create env file (WEB) | |
run: | | |
touch .env | |
echo SECRET_ENDPOINT=${{ secrets.SECRET_ENDPOINT }} > .env | |
echo SECRET_API_SECRET=${{ secrets.SECRET }} >> .env | |
cat .env | |
- name: Copy env to Web | |
run: mv .env ./web | |
- name: Create env file (ROOT) | |
run: | | |
touch .env | |
echo TOR_SERVICE_KEY=${{ secrets.TOR_SERVICE_KEY }} > .env | |
echo POSTGRES_USER=${{ secrets.POSTGRES_USER }} >> .env | |
echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env | |
echo POSTGRES_HOST=${{ secrets.POSTGRES_HOST }} >> .env | |
echo POSTGRES_DB=${{ secrets.POSTGRES_DB }} >> .env | |
echo WIREGUARD_PRIVATE_KEY=${{ secrets.WIREGUARD_PRIVATE_KEY }} >> .env | |
echo WIREGUARD_ADDRESSES=${{ secrets.WIREGUARD_ADDRESSES }} >> .env | |
echo SERVER_CITIES=${{ secrets.SERVER_CITIES }} >> .env | |
cat .env | |
- name: Docker run | |
run: docker compose up -d --force-recreate --build |