proper directory

This commit is contained in:
Torsten Curdt
2020-11-05 12:52:50 +01:00
parent afa7abc646
commit 1eed73af48
5 changed files with 0 additions and 33 deletions

75
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,75 @@
name: ci
on: [push, pull_request]
env:
project: 'release-node'
jobs:
test:
strategy:
matrix:
node-version: [12.x, 14.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- 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
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache
id: cache-modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- name: Install
if: steps.cache-modules.outputs.cache-hit != 'true'
run: npm install
- 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
# .
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
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 }}

17
.github/workflows/cleanup.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: cleanup
on:
schedule:
- cron: '1 1 * * 1' # once a week clean out old artifacts
jobs:
expire:
runs-on: ubuntu-latest
steps:
- name: Expire Artifacts
uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 1hour

35
.github/workflows/dockerhub.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: dockerhub
on:
release:
types: [published]
env:
project: 'release-node'
jobs:
dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: |
docker build -t ${{ env.project }} .
- name: Login
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Tag
run: |
docker tag ${{ env.project }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.project }}:${GITHUB_REF/refs\/tags\/v/}
docker tag ${{ env.project }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.project }}:latest
- name: Push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.project }}

View File

@@ -1,33 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.

21
.github/workflows/npm.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: npm
on:
release:
types: [published]
jobs:
npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish --access=public