Skip to content

add JWT_VALID_TIME_ACTIVATE_ACCOUNT to prod.yml #12

add JWT_VALID_TIME_ACTIVATE_ACCOUNT to prod.yml

add JWT_VALID_TIME_ACTIVATE_ACCOUNT to prod.yml #12

Workflow file for this run

name: Build and Publish Production Docker Images
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
PASSWORD_RESET_LINK: "127.0.0.1"
JWT_VALID_TIME_ACCESS: 1200
JWT_VALID_TIME_REFRESH: 604800
JWT_VALID_TIME_PWD_RESET: 600
JWT_VALID_TIME_ACTIVATE_ACCOUNT: 36000
JWT_ALGORITHM: "HS256"
MAIL_USERNAME: "[email protected]"
MAIL_PORT: 587
MAIL_SERVER: "smtp.gmail.com"
MAIL_FROM_NAME: "Kosjenka Support"
SUPERADMIN_LOGIN: "[email protected]"
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: dostini
password: ${{ secrets.TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ghcr.io/dostini/api
- name: Crate env file with secrets
run: |
echo "DATABASE_URL=${{ secrets.PROD_DATABASE_URL }}" >> .env
echo "JWT_SECRET=${{ secrets.PROD_JWT_SECRET }}" >> .env
echo "MAIL_PASSWORD=${{ secrets.MAIL_PASSWORD }}" >> .env
echo "JWT_VALID_TIME_ACCESS=1200" >> .env
echo "JWT_VALID_TIME_REFRESH=604800" >> .env
echo "JWT_VALID_TIME_PWD_RESET=600" >> .env
echo "JWT_VALID_TIME_ACTIVATE_ACCOUNT=36000" >> .env
echo "JWT_ALGORITHM=HS256" >> .env
echo "[email protected]" >> .env
echo "MAIL_PORT=587" >> .env
echo "MAIL_SERVER=smtp.gmail.com" >> .env
echo "MAIL_FROM_NAME=Kosjenka Support" >> .env
echo "[email protected]" >> .env
echo "SUPERADMIN_PASSWORD=${{ secrets.PROD_SUPERADMIN_PASSWORD }}" >> .env
echo "PASSWORD_RESET_LINK=https://admin-kosjenka.vercel.app/password/confirm" >> .env
echo "ACTIVATE_ACCOUNT_LINK=https://admin-kosjenka.vercel.app/admins/confirm" >> .env
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: cp fly.prod.toml fly.toml && flyctl deploy --local-only --image ghcr.io/dostini/api:main