This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
Run Docker Compose #13
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: Run Docker Compose | |
on: | |
workflow_call: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
deploy: | |
runs-on: [self-hosted, donggle-dev] | |
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_DEVELOPMENT }}" >> .env | |
echo "INFRA_PROFILE=${{ vars.INFRA_PROFILE_DEVELOPMENT }}" >> .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_DEVELOPMENT }} | |
sudo docker image prune -af |