Skip to content

Feat:기사 요약정보 목록조회, 상세조회 페이지 구현 #17

Feat:기사 요약정보 목록조회, 상세조회 페이지 구현

Feat:기사 요약정보 목록조회, 상세조회 페이지 구현 #17

Workflow file for this run

name: Deploy to S3
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
#
# - name: Clean install
# run: |
# rm -rf node_modules package-lock.json pnpm-lock.yaml
- name: Decode and export env vars
run: |
echo "${{ secrets.APP_ENV_B64 }}" | base64 --decode | tr -d '\r' > .env
sed '/^[[:space:]]*#/d; s/[[:space:]]*#.*$//; /^[[:space:]]*$/d' .env > .env.filtered
# 모든 환경변수를 GitHub Actions 환경변수로 export
# 마지막 줄에 개행이 없어도 처리 가능
while IFS='=' read -r key value || [ -n "$key" ]; do
if [[ -n "$key" ]]; then
echo "$key=$value" >> "$GITHUB_ENV"
echo "Processing: key='$key' value='$value'"
fi
done < .env.filtered
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-files
path: ${{ env.NEXT_BUILD_PATH }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Decode and export env vars
run: |
echo "${{ secrets.APP_ENV_B64 }}" | base64 --decode | tr -d '\r' > .env
sed '/^[[:space:]]*#/d; s/[[:space:]]*#.*$//; /^[[:space:]]*$/d' .env > .env.filtered
# 모든 환경변수를 GitHub Actions 환경변수로 export
# 마지막 줄에 개행이 없어도 처리 가능
while IFS='=' read -r key value || [ -n "$key" ]; do
if [[ -n "$key" ]]; then
echo "$key=$value" >> "$GITHUB_ENV"
echo "Processing: key='$key' value='$value'"
fi
done < .env.filtered
- name: Checkout source
uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-files
path: ${{ env.NEXT_BUILD_PATH }}
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
AWS_S3_BUCKET: ${{ env.S3_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.AWS_REGION }}
SOURCE_DIR: ${{ env.NEXT_BUILD_PATH }}
#
# - name: Invalidate CloudFront cache
# if: success()
# run: |
# aws cloudfront create-invalidation \
# --distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} \
# --paths "/*"