diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 1f9f1ba..9fa80cf 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -49,28 +49,16 @@ jobs: rm oracle_cloud_key - name: Deploy to Oracle Cloud - env: - OCI_CLI_AUTH: instance_principal - DB_ROOT_PASSWORD: ${{ secrets.DB_ROOT_PASSWORD }} - DB_USER: ${{ secrets.DB_USER }} - DB_PASSWORD: ${{ secrets.DB_PASSWORD }} - DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} - DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} run: | echo "${{ secrets.ORACLE_CLOUD_SSH_PRIVATE_KEY }}" > oracle_cloud_key chmod 600 oracle_cloud_key ssh -i oracle_cloud_key -o StrictHostKeyChecking=no ${{ secrets.ORACLE_CLOUD_SSH_USER }}@${{ secrets.ORACLE_CLOUD_IP }} << EOF cd website docker compose down - echo "$DOCKER_HUB_ACCESS_TOKEN" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin - export DB_ROOT_PASSWORD=${DB_ROOT_PASSWORD} - export DB_USER=${DB_USER} - export DB_PASSWORD=${DB_PASSWORD} - export DOCKER_IMAGE=${DOCKER_HUB_USERNAME}/vow-website:latest + export DOCKER_IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/vow-website:latest export COMPOSE_FILE_DIR=/home/opc/website docker compose pull docker compose up -d docker image prune -f - docker logout EOF rm oracle_cloud_key \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ff51fa8..106eaa1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.8' services: web: - image: ${DOCKER_IMAGE:-vow-website:latest} + image: ${DOCKER_IMAGE:-kmaxi/vow-website:latest} ports: - "80:80" environment: @@ -20,6 +20,8 @@ services: - adminer volumes: - dynamic_data:/var/www/html/dynamic + env_file: + - .env website: image: mariadb:10.5.24 @@ -32,6 +34,8 @@ services: - "3306:3306" volumes: - website_data:/var/lib/mysql + env_file: + - .env api: image: mariadb:10.5.24 @@ -44,6 +48,8 @@ services: - "3307:3306" volumes: - api_data:/var/lib/mysql + env_file: + - .env adminer: image: adminer