-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaning up and improving the CI/CD pipeline (#1122)
* no artifacts, not required * renamed * cleanup and comments * pass build args * two-step docker build
- Loading branch information
Showing
5 changed files
with
52 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,62 @@ | ||
name: ci | ||
|
||
on: [push, pull_request] | ||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
project: 'release-node' | ||
project: 'gun' | ||
|
||
jobs: | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
node-version: [14.x] # [12.x, 14.x] | ||
os: [ubuntu-latest] #, macos-latest, windows-latest] | ||
node-version: [ 14.x ] | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
# checkout the code | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# verify the version in package.json matches the release tag | ||
- name: Version | ||
uses: tcurdt/action-verify-version-npm@master | ||
|
||
# setup the node version | ||
- name: Setup Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
# cache node_modules if we can | ||
- name: Cache | ||
id: cache-modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('package.json') }} | ||
|
||
# ottherweise run install | ||
- name: Install | ||
if: steps.cache-modules.outputs.cache-hit != 'true' | ||
run: npm install | ||
|
||
# run tests | ||
- name: Test | ||
run: npm test | ||
|
||
# create release artifacts to publish as github release | ||
# - name: Upload | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: ${{ env.project }}_${{ matrix.os }}_${{ matrix.node-version }} | ||
# path: | | ||
# !.git | ||
# !.github | ||
# !node_modules | ||
# . | ||
|
||
# only create a release for tags named 'v*' | ||
release: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
needs: [test] | ||
needs: [ test ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# - name: Download | ||
# uses: actions/download-artifact@v2 | ||
# with: | ||
# path: artifacts | ||
# - name: Archives | ||
# run: find artifacts -mindepth 1 -maxdepth 1 -exec tar -C {} -cvzf {}.tgz . \; | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
# with: | ||
# files: | | ||
# artifacts/*.tgz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
# create github release (which triggers the release workflows) | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} |
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: npm | |
|
||
on: | ||
release: | ||
types: [published] | ||
types: [ published ] | ||
|
||
jobs: | ||
|
||
|
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