Skip to content

Commit

Permalink
chore: upgrade workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Feb 26, 2021
1 parent 9d5dad6 commit 66155b5
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/branch-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Merge Branch

on:
push:
branches: [ imgbot ]
branches: [imgbot]

jobs:
merge-branch:
Expand All @@ -14,4 +14,4 @@ jobs:
github_token: ${{ github.token }}
source_ref: ${{ github.ref }}
target_branch: main
commit_message_template: '[Automated] Merged {source_ref} into {target_branch}'
commit_message_template: "[Automated] Merged {source_ref} into {target_branch}"
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Deploy

on:
push:
branches: [ main ]
branches: [main]

jobs:
build-and-deploy:
Expand All @@ -12,13 +12,13 @@ jobs:
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: "12"
check-latest: true

- name: Cache node modules
uses: actions/cache@v2
id: cache
Expand All @@ -27,15 +27,14 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install

- name: Build
run:
npm run build

run: npm run build

- name: Deploy
uses: JamesIves/[email protected]
with:
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '29 14 * * 2'
- cron: "29 14 * * 2"

jobs:
analyze:
Expand All @@ -28,40 +28,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
24 changes: 12 additions & 12 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ name: Prettier

on:
push:
branches: [ main ]
branches: [main]

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{html,js,md,vue,less,css}
commit_message: 'style: prettify code'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{html,js,md,vue,less,css}
commit_message: "style: prettify code"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 5 additions & 6 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: Sync

on:
page_build
on: page_build

jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps:
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
with:
source-repo: [email protected]:doocs/md.git
destination-repo: [email protected]:Doocs/md.git

0 comments on commit 66155b5

Please sign in to comment.