Skip to content

Commit

Permalink
[#68] fix: amd64만 빌드하도록 변경
Browse files Browse the repository at this point in the history
- registry cache 사용
  • Loading branch information
NaMinhyeok committed Feb 6, 2025
1 parent 64f902f commit e247bc0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- fix/**

env:
NCP_ACCESS_KEY: ${{ secrets.NCP_ACCESS_KEY }}
Expand Down Expand Up @@ -34,7 +35,7 @@ jobs:
id: ip
run: |
PUBLIC_IP=$(curl -s https://ifconfig.me)
echo "::set-output name=public_ip::$PUBLIC_IP"
echo "PUBLIC_IP=$PUBLIC_IP" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -52,12 +53,12 @@ jobs:
context: .
file: ./jaknaeso-server/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
tags: |
${{ env.REGISTRY_URL }}/${{ env.SERVICE_NAME }}:${{ env.BUILD_NUMBER }}
${{ env.REGISTRY_URL }}/${{ env.SERVICE_NAME }}:latest
cache-from: type=registry,ref=${{ env.REGISTRY_URL }}/${{ env.SERVICE_NAME}}:latest
cache-to: type=inline
cache-from: type=registry,ref=${{ env.REGISTRY_URL }}/${{ env.SERVICE_NAME}}:buildcache,image-manifest=true,oci-mediatypes=true
cache-to: type=registry,ref=${{ env.REGISTRY_URL }}/${{ env.SERVICE_NAME}}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true

- name: Setting NCP CLI & Credentials
run: |
Expand All @@ -73,8 +74,8 @@ jobs:
cd ~/cli_linux
./ncloud vserver addAccessControlGroupInboundRule \
--regionCode KR --vpcNo ${{ env.NCP_VPC_ID }} \
--accessControlGroupNo ${{ secrets.NCP_AGC_ID }} \
--accessControlGroupRuleList "protocolTypeCode='TCP', ipBlock='${{ steps.ip.outputs.public_ip }}/32', portRange='22'" > /dev/null 2>&1
--accessControlGroupNo ${{ env.NCP_AGC_ID }} \
--accessControlGroupRuleList "protocolTypeCode='TCP', ipBlock='${{ env.PUBLIC_IP }}/32', portRange='22'" > /dev/null 2>&1
- name: Create .env file
run: |
Expand Down Expand Up @@ -111,7 +112,7 @@ jobs:
docker login ${{ env.REGISTRY_URL }} -u ${{ env.NCP_ACCESS_KEY }} -p ${{ env.NCP_SECRET_KEY }}
docker-compose -f ~/docker-compose.yml pull
docker-compose -f ~/docker-compose.yml up -d
docker-compose -f ~/docker-compose.yml up -d --remove-orphans
docker-compose exec nginx nginx -s reload
chmod +x ~/scripts/server/register-certbot-cron-job.sh
Expand All @@ -125,4 +126,4 @@ jobs:
./ncloud vserver removeAccessControlGroupInboundRule \
--regionCode KR --vpcNo ${{ env.NCP_VPC_ID }} \
--accessControlGroupNo ${{ env.NCP_AGC_ID }} \
--accessControlGroupRuleList "protocolTypeCode='TCP', ipBlock='${{ steps.ip.outputs.public_ip }}/32', portRange='22'" > /dev/null 2>&1
--accessControlGroupRuleList "protocolTypeCode='TCP', ipBlock='${{ env.PUBLIC_IP }}/32', portRange='22'" > /dev/null 2>&1

0 comments on commit e247bc0

Please sign in to comment.