Skip to content

Commit

Permalink
Edit: GitHub Actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlelek committed Apr 29, 2024
1 parent 79e2e47 commit 88b9829
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub Actions
Documentation and search here
https://github.com/marketplace?type=actions
22 changes: 13 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
---
# https://github.com/marketplace/actions/build-and-push-docker-images
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
# https://github.com/docker/login-action

name: Docker Image CI

on:
push:
branches: ["main"]

jobs:

build:

runs-on: ubuntu-latest
environment: Docker

steps:
# - uses: actions/checkout@v3
# name: Build the Docker image
# run: docker build . --file Dockerfile --tag raento/raneto:latest-$(date +%s)
# https://github.com/marketplace/actions/checkout
# - name: Build the Docker image
# uses: actions/checkout@v4
# run: docker build . --file Dockerfile --tag raneto/raneto:latest-$(date +%s)

# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# https://github.com/marketplace/actions/docker-login
# https://github.com/docker/login-action
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
#context: .
push: true
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

name: Docker Release

on:
workflow_dispatch:
inputs:
Expand All @@ -12,23 +11,33 @@ on:
default: 'latest'

jobs:

build:

runs-on: ubuntu-latest
environment: Docker

steps:
# https://github.com/marketplace/actions/checkout
# - name: Build the Docker image
# uses: actions/checkout@v4
# run: docker build . --file Dockerfile --tag raneto/raneto:latest-$(date +%s)

# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# https://github.com/marketplace/actions/docker-login
# https://github.com/docker/login-action
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
#context: .
push: true
tags: "raneto/raneto:${{ github.event.inputs.version }}"
tags: "raneto/raneto:${{ github.event.inputs.version }}"
29 changes: 18 additions & 11 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: ["main"]
Expand All @@ -13,22 +12,30 @@ on:
jobs:
build:

# List
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]
# Windows is currently borked
# https://github.com/nodejs/node/issues/52682
# Disabling for now
# windows-latest
os: [ubuntu-latest]
node_version: [20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

# OS List
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4
# https://github.com/marketplace/actions/setup-node-js-environment
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
node-version: ${{ matrix.node_version }}
#cache: 'npm'
- run: npm ci
# - run: npm run build --if-present
- run: npm test
- run: npm run lint
- run: npm run prettier

0 comments on commit 88b9829

Please sign in to comment.