Update workflow.yml

This commit is contained in:
lowlighter
2021-02-06 00:08:58 +01:00
parent a9716e0f4b
commit dd90d55a8a

View File

@@ -41,24 +41,6 @@ jobs:
- name: Run tests - name: Run tests
run: docker run --workdir=/metrics --entrypoint="" lowlighter/metrics:${{ github.head_ref || 'master' }} npm test run: docker run --workdir=/metrics --entrypoint="" lowlighter/metrics:${{ github.head_ref || 'master' }} npm test
# Update plugins and template indexes, along with README.md
update-indexes:
name: Publish rebuilt metrics indexes
runs-on: ubuntu-latest
needs: [ build ]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 15
- name: Setup metrics
run: npm ci
- name: Publish rebuild metrics indexes
run: npm run index -- publish
# Run CodeQL on branch # Run CodeQL on branch
analyze: analyze:
name: Analyze code name: Analyze code
@@ -75,6 +57,24 @@ jobs:
- name: Analyze code - name: Analyze code
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v1
# Update plugins and template indexes, along with README.md
update-indexes:
name: Publish rebuilt metrics indexes
runs-on: ubuntu-latest
needs: [ build, analyze ]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 15
- name: Setup metrics
run: npm ci
- name: Publish rebuild metrics indexes
run: npm run index -- publish
# Build docker image from master and publish it to GitHub registry # Build docker image from master and publish it to GitHub registry
docker-master: docker-master:
name: Publish master to GitHub registry name: Publish master to GitHub registry
@@ -112,7 +112,7 @@ jobs:
docker-release: docker-release:
name: Publish release to GitHub registry name: Publish release to GitHub registry
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ build, analyze, update-indexes, action-master-test ] needs: [ action-master-test ]
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[release]') if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[release]')
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -150,7 +150,7 @@ jobs:
deploy-master: deploy-master:
name: Deploy lowlighter/metrics@master name: Deploy lowlighter/metrics@master
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ build, analyze, update-indexes, action-master-test ] needs: [ action-master-test ]
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[deploy]') if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[deploy]')
steps: steps:
- name: Deploy web instance - name: Deploy web instance