It's the little things.... 8 #51
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: Deploy Baphomet Server | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Set Environment Variables | |
env: | |
ATLAS_DB_PASSWORD: ${{ secrets.ATLAS_DB_PASSWORD }} | |
ATLAS_DB_USERNAME: ${{ secrets.ATLAS_DB_USERNAME }} | |
ATLAS_CLUSTER: ${{ secrets.ATLAS_CLUSTER }} | |
ATLAS_DB: ${{ secrets.ATLAS_DB }} | |
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }} | |
REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }} | |
SSL_PRIVATE_KEY: ${{ secrets.IONOS_SSL_PRIVATE_KEY }} | |
SSL_CERT: ${{ secrets.IONOS_SSL_CERT }} | |
SSL_CERT_INTERMEDIATE: ${{ secrets.IONOS_SSL_CERT_INTERMEDIATE}} | |
run: | | |
echo "ATLAS_DB_PASSWORD=${ATLAS_DB_PASSWORD}" >> ~/.env | |
echo "ATLAS_DB_USERNAME=${ATLAS_DB_USERNAME}" >> ~/.env | |
echo "ATLAS_CLUSTER=${ATLAS_CLUSTER}" >> ~/.env | |
echo "ATLAS_DB=${ATLAS_DB}" >> ~/.env | |
echo "ACCESS_TOKEN_SECRET=${ACCESS_TOKEN_SECRET}" >> ~/.env | |
echo "REFRESH_TOKEN_SECRET=${REFRESH_TOKEN_SECRET}" >> ~/.env | |
echo "SSL_CERT= ${{ secrets.IONOS_SSL_CERT }}" >> ~/.env | |
echo "SSL_PRIVATE_KEY= ${{ secrets.IONOS_SSL_PRIVATE_KEY }}" >> ~/.env | |
echo "SSL_CERT_INTERMEDIATE=${{ secrets.IONOS_SSL_CERT_INTERMEDIATE}}" >> ~/.env | |
- name: Install Docker Compose | |
run: | | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | |
- name: Login to Docker Hub | |
run: sudo docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}} | |
- name: Build and Push Docker Images | |
run: | | |
sudo docker-compose -f docker-compose.yml build | |
sudo docker-compose -f docker-compose.yml push | |
deploy: | |
needs: build | |
runs-on: self-hosted | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Pull Image from Docker Hub | |
run: sudo docker-compose -f docker-compose.yml pull | |
- name: Delete Old Container | |
run: sudo docker rm -f baphomet-server-container | |
- name: Run Docker Container | |
run: sudo docker-compose -f docker-compose.yml up -d |