Skip to content

Commit

Permalink
Merge pull request #6 from ALPHACamp/chore/CICD
Browse files Browse the repository at this point in the history
chore: delete package except for latest 2 version
  • Loading branch information
tim80411 authored Jul 15, 2023
2 parents 845cb3b + cb9ad37 commit 71eff3c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
COMPOSE_FILE_PATH: /home/deploy

jobs:
build-and-push-image:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -43,6 +43,7 @@ jobs:
type=raw,value=deploy
- name: Build and push Docker image
id: build
uses: docker/build-push-action@v4
with:
context: .
Expand All @@ -57,12 +58,6 @@ jobs:
PORT=${{secrets.PORT}}
labels: ${{ steps.meta.outputs.labels }}

# need: docker@remote
ssh-and-run-compose:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- uses: actions/checkout@v3
- name: Scp compose file to server
uses: appleboy/[email protected]
with:
Expand Down Expand Up @@ -90,3 +85,11 @@ jobs:
sudo docker logout ${{env.REGISTRY}}
echo "==Clean Up Prune Image=="
sudo 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
uses: actions/[email protected]
with:
package-name: ${{ github.event.repository.name }}
package-type: container
min-versions-to-keep: 2

0 comments on commit 71eff3c

Please sign in to comment.