Skip to content

Commit

Permalink
Create s3.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
atorber authored Nov 30, 2023
1 parent c4b3064 commit 5f4774f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 编译的静态文件部署到S3存储
name: Node.js Build and Deploy to S3

on:
create:
tags:
- '*'

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages

steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Install Dependencies
run: npm install

- name: Build
run: npm run build

- name: Deploy to S3
uses: jakejarvis/[email protected]
with:
args: --acl public-read --follow-symlinks --delete --endpoint-url ${{ secrets.CUSTOM_S3_ENDPOINT }}
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }} # Or your AWS region
SOURCE_DIR: 'dist'

0 comments on commit 5f4774f

Please sign in to comment.