-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ALPHACamp/chore/CICD
chore: delete package except for latest 2 version
- Loading branch information
Showing
1 changed file
with
10 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ env: | |
COMPOSE_FILE_PATH: /home/deploy | ||
|
||
jobs: | ||
build-and-push-image: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
@@ -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: . | ||
|
@@ -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: | ||
|
@@ -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 |