Skip to content

Commit

Permalink
ci(Deploy Dockerimage): Refactor Pipeline and add Job to publish Pipe…
Browse files Browse the repository at this point in the history
…line (#330)

* ci(Deploy Dockerimage): Refactor Pipline and add Job to publish Pipline

Refactored Piplined so they can run in parallel. In this I added
a better solution to download the @Yes-Theroy-Fam packages
without manually write the file.
Added Pipline to Build and publish a Dockerimage on release.

* fix feedback from GH actions

* optimize run

* Update .github/workflows/linting.yml

Co-authored-by: geisterfurz007 <[email protected]>

Co-authored-by: geisterfurz007 <[email protected]>
  • Loading branch information
Adrian Görisch and geisterfurz007 authored Jun 28, 2021
1 parent fe620f8 commit fa73ddd
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 10 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Publish Dockerimage

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

on:
release:
types: [ created ]
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
27 changes: 17 additions & 10 deletions .github/workflows/ci.yml → .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
name: Node.js CI Linting Test
name: Linting

on: [ push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [ 14.x ]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
Expand All @@ -17,16 +23,17 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
- name: setup node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
registry-url: 'https://npm.pkg.github.com'
scope: '@Yes-Theory-Fam'
node-version: ${{ matrix.node-version }}
- name: Write authentication to file
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: install and lint
run: |
npm ci
npm run lint
- name: testing
run: |
npm run test
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Testing

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: install on node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
registry-url: 'https://npm.pkg.github.com'
scope: '@Yes-Theory-Fam'
node-version: ${{ matrix.node-version }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: install and testing
run: |
npm ci
npm run test

0 comments on commit fa73ddd

Please sign in to comment.