Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix deployment #9

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
username: ${{ secrets.PROD_SSH_DEPLOY_USER }}
key: ${{ secrets.PROD_SSH_PRIVATE_KEY }}
source: './docker-compose.yml'
target: ${{env.COMPOSE_FILE_PATH}}
target: ${{ env.COMPOSE_FILE_PATH }}

# https://docs.github.com/en/packages/learn-github-packages/introduction-to-github-packages#authenticating-to-github-packages
- name: Ssh server and run docker-compose
Expand All @@ -76,15 +76,15 @@ jobs:
key: ${{ secrets.PROD_SSH_PRIVATE_KEY }}
script: |
echo "==Docker Login=="
echo "${{secrets.ACCESS_PACKAGE_TOKEN}}" | sudo docker login ${{env.REGISTRY}} -u ${{env.GITHUB_IDENTITY}} --password-stdin
echo "${{secrets.ACCESS_PACKAGE_TOKEN}}" | docker login ${{env.REGISTRY}} -u ${{env.GITHUB_IDENTITY}} --password-stdin
echo "==Pull Image=="
sudo docker-compose -f ${{env.COMPOSE_FILE_PATH}}/docker-compose.yml pull
docker-compose -f ${{env.COMPOSE_FILE_PATH}}/docker-compose.yml pull
echo "==Compose Up=="
sudo docker-compose -f ${{env.COMPOSE_FILE_PATH}}/docker-compose.yml up -d
docker-compose -f ${{env.COMPOSE_FILE_PATH}}/docker-compose.yml up -d
echo "==Docker Logout=="
sudo docker logout ${{env.REGISTRY}}
docker logout ${{env.REGISTRY}}
echo "==Clean Up Prune Image=="
sudo docker image prune -f
docker image prune -f

# for saving money(limit: 500MB, [ref](https://docs.github.com/en/billing/managing-billing-for-github-packages/about-billing-for-github-packages))
- name: Delete Package Versions
Expand Down