Skip to content

some renaming and dockerignore stuff #4

some renaming and dockerignore stuff

some renaming and dockerignore stuff #4

Workflow file for this run

name: Deploy
on:
push:
branches:
- devops(dockerfile)/dev
- main
pull_request:
branches:
- main
types:
- closed
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
concurrency:
group: deployment_lock
cancel-in-progress: false
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.KEY }}" > ~/.ssh/key
chmod 600 ~/.ssh/key
ssh-keyscan ${{ secrets.HOST }} >> ~/.ssh/known_hosts
- name: Create .env file
run: |
echo 'DATABASE_URL="${{ secrets.DATABASE_URL }}"' >> .env
echo 'NEXTAUTH_URL="${{ secrets.NEXTAUTH_URL }}"' >> .env
echo 'NEXT_PUBLIC_LEPTON_API_URL="${{ secrets.NEXT_PUBLIC_LEPTON_API_URL }}"' >> .env
echo 'ALLOWED_GROUP_SLUGS="${{ secrets.ALLOWED_GROUP_SLUGS }}"' >> .env
echo 'NEXTAUTH_SECRET="${{ secrets.NEXTAUTH_SECRET }}"' >> .env
- name: Copy .env to OpenStack server
run: |
scp -v -i ~/.ssh/key .env ${{ secrets.USER }}@${{ secrets.HOST }}:${{ secrets.PATH }}
- name: Deploy to OpenStack server
run: |
ssh -v -i ~/.ssh/key ${{ secrets.USER }}@${{ secrets.HOST }} << 'ENDSSH'
cd ${{ secrets.PATH }}
chmod 0600 .env
git pull
make prod
ENDSSH