Skip to content

Commit 0047e57

Browse files
ci: update node and docker
1 parent 52abd24 commit 0047e57

File tree

7 files changed

+40
-55
lines changed

7 files changed

+40
-55
lines changed

.github/actions/build-template-action/script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ echo "- ${INPUT_PROJECT^} ${INPUT_TAG} template built :rocket:" >> $GITHUB_STEP_
4545

4646
# This step is important, it set the "filepath" output variable
4747
# Will be accessible in workflow
48-
echo "::set-output name=filepath::${ARCHIVE}"
48+
echo "filepath=${ARCHIVE}" >> "$GITHUB_OUTPUT"

.github/workflows/deploy.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,78 +15,74 @@ concurrency:
1515

1616
jobs:
1717
docker-build-demo:
18-
# We can skip deployment by adding [skip] in the commit body
19-
if: "!contains(github.event.head_commit.message, '[skip]')"
2018
runs-on: ubuntu-latest
2119

2220
steps:
23-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2422
- name: Set up dockertags
2523
run: |
2624
echo "dockertags=digisquad/cssninja.hr-demo:latest" >> $GITHUB_ENV
2725
2826
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v2
27+
uses: docker/setup-qemu-action@v3
3028

3129
- name: Set up Docker Buildx
32-
uses: docker/setup-buildx-action@v2
30+
uses: docker/setup-buildx-action@v3
3331

3432
- name: Login to DockerHub
35-
uses: docker/login-action@v2
33+
uses: docker/login-action@v3
3634
with:
3735
username: ${{ secrets.DOCKERHUB_USERNAME }}
3836
password: ${{ secrets.DOCKERHUB_TOKEN }}
3937

4038
- name: Build and push
4139
id: docker_build
42-
uses: docker/build-push-action@v3
40+
uses: docker/build-push-action@v5
4341
timeout-minutes: 60
4442
with:
4543
push: true
4644
tags: ${{ env.dockertags }}
47-
cache-from: type=registry,ref=${{ env.dockertags }}
48-
cache-to: type=inline
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max
4947

5048
docker-build-api:
51-
# We can skip deployment by adding [skip] in the commit body
52-
if: "!contains(github.event.head_commit.message, '[skip]')"
5349
runs-on: ubuntu-latest
5450

5551
steps:
56-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
5753
- name: Set up dockertags
5854
run: |
5955
echo "dockertags=digisquad/cssninja.hr-api:latest" >> $GITHUB_ENV
6056
6157
- name: Set up QEMU
62-
uses: docker/setup-qemu-action@v2
58+
uses: docker/setup-qemu-action@v3
6359

6460
- name: Set up Docker Buildx
65-
uses: docker/setup-buildx-action@v2
61+
uses: docker/setup-buildx-action@v3
6662

6763
- name: Login to DockerHub
68-
uses: docker/login-action@v2
64+
uses: docker/login-action@v3
6965
with:
7066
username: ${{ secrets.DOCKERHUB_USERNAME }}
7167
password: ${{ secrets.DOCKERHUB_TOKEN }}
7268

7369
- name: Build and push
7470
id: docker_build
75-
uses: docker/build-push-action@v3
71+
uses: docker/build-push-action@v5
7672
timeout-minutes: 60
7773
with:
7874
file: ./Dockerfile.api
7975
push: true
8076
tags: ${{ env.dockertags }}
81-
cache-from: type=registry,ref=${{ env.dockertags }}
82-
cache-to: type=inline
77+
cache-from: type=gha
78+
cache-to: type=gha,mode=max
8379

8480
deploy:
8581
runs-on: ubuntu-latest
8682
needs: [docker-build-demo, docker-build-api]
8783

8884
steps:
89-
- uses: actions/checkout@v3
85+
- uses: actions/checkout@v4
9086
- name: Prepare
9187
uses: appleboy/ssh-action@master
9288
with:
@@ -114,5 +110,5 @@ jobs:
114110
script_stop: true
115111
script: |
116112
cd ${{ secrets.HOST_DIRECTORY }}
117-
docker-compose pull
118-
docker-compose up -d --force-recreate --remove-orphans
113+
docker compose pull
114+
docker compose up -d --force-recreate --remove-orphans

.github/workflows/release.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,31 @@ on:
77

88
jobs:
99
release:
10-
# setup strategy matrix, so we can share same pnpm cache
11-
strategy:
12-
matrix:
13-
os: [ubuntu-latest]
14-
node-version: [18]
15-
runs-on: ${{ matrix.os }}
10+
runs-on: ubuntu-latest
1611

1712
steps:
1813
# Checkout action retreive the source (git clone)
19-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
2015
with:
2116
fetch-depth: 0 # needed to retreive all git history
2217

2318
# Enable corepack, note that nodejs is already installed
2419
- run: corepack enable
2520

2621
# Setup pnpm with cache
27-
- uses: actions/setup-node@v3
22+
- uses: actions/setup-node@v4
2823
with:
29-
node-version: ${{ matrix.node-version }}
24+
node-version: 20
3025
cache: "pnpm"
3126

3227
# Compute tag and capitalized product name
3328
- id: meta
3429
name: release meta
3530
run: |
3631
project=${GITHUB_REPOSITORY#*/}
37-
echo ::set-output name=project::${project}
38-
echo ::set-output name=project-capitalized::${project^}
39-
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
32+
echo "PROJECT=${project}" >> "$GITHUB_OUTPUT"
33+
echo "PROJECT_CAP=${project^}" >> "$GITHUB_OUTPUT"
34+
echo "TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
4035
# This is where we generate releases assets.
4136
# It use a github action in the current directory
4237
# which contains a shell script to create the archive.
@@ -45,8 +40,8 @@ jobs:
4540
name: build release template
4641
uses: ./.github/actions/build-template-action
4742
with:
48-
tag: ${{ steps.meta.outputs.tag }}
49-
project: ${{ steps.meta.outputs.project }}
43+
tag: ${{ steps.meta.outputs.TAG }}
44+
project: ${{ steps.meta.outputs.PROJECT }}
5045

5146
# We re-generate the changelog using a subset of standard-version
5247
# The content is generated in a temp /CHANGELOG_RELEASE.md file
@@ -59,11 +54,11 @@ jobs:
5954
# Prepare the draft github release
6055
- id: create_release
6156
name: create github draft release
62-
uses: softprops/action-gh-release@v1
57+
uses: softprops/action-gh-release@v2
6358
with:
6459
# Use outputs from meta and changelog
65-
tag_name: ${{ steps.meta.outputs.tag }}
66-
name: ${{ steps.meta.outputs.project-capitalized }} ${{ steps.meta.outputs.tag }}
60+
tag_name: ${{ steps.meta.outputs.TAG }}
61+
name: ${{ steps.meta.outputs.PROJECT_CAP }} ${{ steps.meta.outputs.TAG }}
6762
body_path: ${{ github.workspace }}/CHANGELOG_RELEASE.md
6863
prerelease: false
6964
# The draft is required to allow file upload

.github/workflows/standard-version.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@ on:
1111

1212
jobs:
1313
standard-version:
14-
# setup strategy matrix, so we can share same pnpm cache
15-
strategy:
16-
matrix:
17-
os: [ubuntu-latest]
18-
node-version: [18]
19-
runs-on: ${{ matrix.os }}
14+
runs-on: ubuntu-latest
2015

2116
steps:
2217
# Checkout action retreive the source (git clone)
23-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
2419
with:
2520
fetch-depth: 0 # needed to retreive all git history
2621
token: ${{ secrets.APP_GITHUB_TOKEN }}
@@ -29,9 +24,9 @@ jobs:
2924
- run: corepack enable
3025

3126
# Setup pnpm with cache
32-
- uses: actions/setup-node@v3
27+
- uses: actions/setup-node@v4
3328
with:
34-
node-version: ${{ matrix.node-version }}
29+
node-version: 20
3530
cache: "pnpm"
3631

3732
# Run "standard-version", which may create a new tag

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM bitnami/node:18 AS build
1+
FROM bitnami/node:20 AS build
22
WORKDIR /app
33

44
ARG API
@@ -14,7 +14,7 @@ COPY . .
1414
RUN API=https://api-hr.cssninja.io/ pnpm build
1515

1616

17-
FROM bitnami/nginx:1.22 AS prod
17+
FROM bitnami/nginx:1.25 AS prod
1818
WORKDIR /app
1919

2020
COPY --from=build /app/dist .

Dockerfile.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM bitnami/node:18 AS build
1+
FROM bitnami/node:20 AS build
22
WORKDIR /app
33

44
RUN corepack enable && corepack prepare pnpm@latest --activate

docker-compose.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
version: '3.7'
1+
networks:
2+
cssninja-services:
3+
external: true
24

35
services:
46
hr-demo:
@@ -39,6 +41,3 @@ services:
3941
traefik.http.routers.hr-api-https.tls.certresolver: 'http'
4042
traefik.http.routers.hr-api-https.service: 'hr-api-https'
4143

42-
networks:
43-
cssninja-services:
44-
external: true

0 commit comments

Comments
 (0)