Skip to content

Commit

Permalink
fix: the path for Upload Artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
id88 committed Oct 11, 2023
1 parent e30dd01 commit 199c325
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: MyWorkflows

run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}
# https://docs.github.com/zh/actions/learn-github-actions/contexts#inputs-context
# https://docs.github.com/zh/actions/learn-github-actions/contexts#github-context
name: Build
# run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}

on:
push: # <event_name>
push:
branches: [main]
paths-ignore:
- "**.md"
Expand All @@ -19,45 +16,31 @@ on:
- "!.github/workflows/build.yml"

jobs:
my-job: # 自定义的<job_id>
runs-on: ubuntu-latest

steps:
- name: Say hello for me
env:
MY_VAR: Hello there!
run: |
echo $MY_VAR
echo "The workflows is running..."
build-project: # 自定义的<job_id>
build-release-files:
runs-on: ${{ matrix.os }}

strategy:
# https://docs.github.com/zh/actions/learn-github-actions/contexts#about-contexts
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout Code # https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsname
uses: actions/checkout@v3 # https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsname
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with: # https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith
with:
node-version: 18

- name: Install Dependencies
run: npm install # https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
run: npm install

- name: Build Release Files
run: npm run build
env: # https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv-%E7%9A%84%E7%A4%BA%E4%BE%8B
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://docs.github.com/zh/actions/security-guides/automatic-token-authentication

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: release_on_${{ matrix.os }}
path: release/
name: build_on_${{ matrix.os }}
path: dist/
retention-days: 5
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vite-vue-ts-navie",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down

0 comments on commit 199c325

Please sign in to comment.