Skip to content

Commit a600fcf

Browse files
Update ci
1 parent 8fa8428 commit a600fcf

File tree

1 file changed

+47
-12
lines changed

1 file changed

+47
-12
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [main, migration]
5+
branches: [main, migration, rc]
66
pull_request:
77
branches: [main, migration]
88
release:
@@ -67,10 +67,43 @@ jobs:
6767
token: ${{ secrets.CODECOV_TOKEN }}
6868
slug: sparcs-kaist/otlplus-web
6969

70+
deploy-dev:
71+
name: Build and Deploy to Dev
72+
runs-on: ubuntu-latest
73+
if: github.ref == 'refs/heads/rc' && github.event_name == 'push'
74+
needs: [format-and-lint, build, test]
75+
permissions:
76+
contents: read
77+
steps:
78+
- uses: actions/checkout@v3
79+
- name: Setup Node
80+
uses: actions/setup-node@v3
81+
with:
82+
node-version: ${{ env.NODE_VERSION }}
83+
cache: yarn
84+
- name: Install yarn dependencies
85+
run: yarn install
86+
- name: Build
87+
run: yarn build
88+
env:
89+
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN_DEV }}
90+
VITE_DEV_MODE: true
91+
- name: Configure AWS credentials
92+
uses: aws-actions/configure-aws-credentials@v4
93+
with:
94+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
95+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
96+
aws-region: ap-northeast-2
97+
- name: Upload to S3 Dev
98+
run: |
99+
aws s3 sync build/ s3://otl-plus-dev/ --delete
100+
echo "Uploaded build files to S3 Dev: s3://otl-plus-dev/"
101+
70102
release-and-upload:
71-
name: Build, Zip, and Upload Release Asset
103+
name: Build and Upload Release Asset
72104
runs-on: ubuntu-latest
73-
needs: [format-and-lint] # Optional: make it depend on other jobs
105+
if: github.event_name == 'release'
106+
needs: [format-and-lint]
74107
permissions:
75108
contents: write
76109
steps:
@@ -84,14 +117,16 @@ jobs:
84117
run: yarn install
85118
- name: Build
86119
run: yarn build
87-
- name: Zip build folder
88-
run: zip -r build-archive.zip build # Assuming 'build' is your output folder
89-
- name: Upload Release Asset
90-
uses: actions/upload-release-asset@v1
91120
env:
92-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN_PROD }}
122+
VITE_DEV_MODE: false
123+
- name: Configure AWS credentials
124+
uses: aws-actions/configure-aws-credentials@v4
93125
with:
94-
upload_url: ${{ github.event.release.upload_url }}
95-
asset_path: ./build-archive.zip
96-
asset_name: build-archive.zip
97-
asset_content_type: application/zip
126+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
127+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
128+
aws-region: ap-northeast-2 # Seoul region, adjust as needed
129+
- name: Upload to S3
130+
run: |
131+
aws s3 sync build/ s3://otl.sparcs.org-1/${{ github.event.release.tag_name }}/ --delete
132+
echo "Uploaded build files to S3: s3://otl.sparcs.org-1/${{ github.event.release.tag_name }}/"

0 commit comments

Comments
 (0)