Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Run Docker Compose Production #4

Run Docker Compose Production

Run Docker Compose Production #4

Workflow file for this run

name: Run Docker Compose Production
on:
workflow_dispatch:
permissions:
contents: read
jobs:
fe-build:
uses: ./.github/workflows/build-fe-prod.yml
secrets: inherit
be-build:
uses: ./.github/workflows/build-be-prod.yml
secrets: inherit
deploy:
runs-on: [self-hosted, donggle-prod]
needs: [fe-build, be-build]
steps:
- uses: actions/checkout@v3
- name: create .env
run: |
touch .env
echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> .env
echo "SPRING_PROFILES_ACTIVE=${{ vars.SPRING_PROFILES_ACTIVE_PRODUCTION }}" >> .env
echo "INFRA_PROFILE=${{ vars.INFRA_PROFILE_PRODUCTION}}" >> .env
## deploy to production
- name: Deploy to prod
run: |
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
sudo chmod +x ./deploy.sh
sudo ./deploy.sh ${{ vars.INFRA_PROFILE_PRODUCTION }}
sudo docker image prune -af