-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (29 loc) · 1.01 KB
/
s3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Deploy to S3
on:
push:
branches: [ "main", "develop" ]
workflow_dispatch:
jobs:
build:
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- name: create env file
run: |
echo VITE_GOOGLE_ANALYTICS_ID=${{ vars.VITE_GOOGLE_ANALYTICS_ID }} >> .env
echo VITE_FAUCET_API_URL=${{ vars.VITE_FAUCET_API_URL }} >> .env
echo VITE_GOOGLE_CAPTCHA_SITEKEY=${{ vars.VITE_GOOGLE_CAPTCHA_SITEKEY }} >> .env
- run: bun run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1
- name: Sync to S3
run: aws s3 sync ./dist s3://${{ secrets.AWS_S3_BUCKET }}