Assetbundle #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Assetbundle" | |
on: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
script: | |
name: Script | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Checkout data | |
uses: actions/checkout@v4 | |
with: | |
ref: data | |
path: data | |
filter: blob:none | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "7.x" | |
- name: Set up S3cmd cli tool | |
uses: s3-actions/[email protected] | |
with: | |
provider: aws | |
region: 'us-east-1' | |
access_key: ${{ secrets.AWS_KEY_ID }} | |
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm ci | |
- name: Create local changes | |
run: npm run assetbundle | |
env: | |
NODE_ENV: production | |
- name: Upload to S3 | |
run: | | |
if [ -d "data/assetbundle/upload" ] && [ -n "$(ls -A "data/assetbundle/upload")" ]; then | |
s3cmd put -r data/assetbundle/upload/* s3://sdorica-wiki/ | |
fi | |
# - uses: shallwefootball/[email protected] | |
# with: | |
# aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
# aws_bucket: 'sdorica-wiki' | |
# source_dir: 'data/assetbundle/upload' | |
# destination_dir: '' | |
- run: | | |
cd data | |
git pull --rebase --autostash | |
- name: Commit files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 更新Assetbundle資料 | |
repository: data |