Skip to content

Commit

Permalink
chore: update to node 18 and update all dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed May 15, 2023
1 parent 8a46aab commit 5f05896
Show file tree
Hide file tree
Showing 8 changed files with 3,702 additions and 4,143 deletions.
250 changes: 125 additions & 125 deletions .github/workflows/node-ci.dev.yml
Original file line number Diff line number Diff line change
@@ -1,125 +1,125 @@
name: Dev Node CI

env:
node-version: 16
node-package-manager: yarn

on:
push:
branches:
- "develop"

jobs:
cache-dependencies:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/cache
- name: Install dependencies
run: yarn install --frozen-lockfile

test:
runs-on: ubuntu-latest
needs: cache-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/test

validate-dependencies:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/validate-dependencies

build:
runs-on: ubuntu-latest
needs:
- test
- validate-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/cache

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Upload client build artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}-client-develop
path: client/dist

- name: Upload server build artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}-server-develop
path: server/dist

check-docker-credentials:
runs-on: ubuntu-latest
needs: build
outputs:
defined: ${{ steps.username.outputs.defined == 'true' && steps.password.outputs.defined == 'true' }}
steps:
- name: Access repository
uses: actions/checkout@v2

- name: Check if has username
id: username
uses: ./.github/actions/check-secret
with:
secret: ${{ secrets.DOCKER_USERNAME }}

- name: Check if has password
id: password
uses: ./.github/actions/check-secret
with:
secret: ${{ secrets.DOCKER_PASSWORD }}

publish-docker-image:
runs-on: ubuntu-latest
if: needs.check-docker-credentials.outputs.defined == 'true'
needs:
- check-docker-credentials
steps:
- name: Access repository
uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: ${{ github.event.repository.name }}-client-develop
path: client/dist

- uses: actions/download-artifact@v2
with:
name: ${{ github.event.repository.name }}-server-develop
path: server/dist

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: "tv2media/${{ github.event.repository.name }}"
tags: |
type=ref,event=branch
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
name: Dev Node CI

env:
node-version: 18
node-package-manager: yarn

on:
push:
branches:
- "develop"

jobs:
cache-dependencies:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/cache
- name: Install dependencies
run: yarn install --frozen-lockfile

test:
runs-on: ubuntu-latest
needs: cache-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/test

validate-dependencies:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/validate-dependencies

build:
runs-on: ubuntu-latest
needs:
- test
- validate-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
- uses: ./.github/actions/cache

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Upload client build artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}-client-develop
path: client/dist

- name: Upload server build artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}-server-develop
path: server/dist

check-docker-credentials:
runs-on: ubuntu-latest
needs: build
outputs:
defined: ${{ steps.username.outputs.defined == 'true' && steps.password.outputs.defined == 'true' }}
steps:
- name: Access repository
uses: actions/checkout@v2

- name: Check if has username
id: username
uses: ./.github/actions/check-secret
with:
secret: ${{ secrets.DOCKER_USERNAME }}

- name: Check if has password
id: password
uses: ./.github/actions/check-secret
with:
secret: ${{ secrets.DOCKER_PASSWORD }}

publish-docker-image:
runs-on: ubuntu-latest
if: needs.check-docker-credentials.outputs.defined == 'true'
needs:
- check-docker-credentials
steps:
- name: Access repository
uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: ${{ github.event.repository.name }}-client-develop
path: client/dist

- uses: actions/download-artifact@v2
with:
name: ${{ github.event.repository.name }}-server-develop
path: server/dist

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: "tv2media/${{ github.event.repository.name }}"
tags: |
type=ref,event=branch
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading

0 comments on commit 5f05896

Please sign in to comment.