Skip to content

Commit

Permalink
Update Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
floscher committed Sep 9, 2024
1 parent 1008cf8 commit 42cde13
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 31 deletions.
55 changes: 31 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
# See https://github.com/Automattic/node-canvas/issues/599#issuecomment-1336370909
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'
Expand All @@ -26,15 +28,16 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
- uses: actions/checkout@v4
- name: Cache build
id: cache-build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules/.cache/nx
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-build
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'
Expand All @@ -55,44 +58,46 @@ jobs:
portal
]
steps:
- uses: actions/checkout@v3
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
- uses: actions/checkout@v4
- name: Cache build
id: cache-build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules/.cache/nx
key: ${{ runner.os }}-nx-${{ hashFiles('package-lock.json') }}
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- run: npm ci
- run: npx lerna run build --scope=@fumix/fu-blog-${{ matrix.workspace }}
- run: echo "This file is placed at the project root, so Github preserves the artifact paths (see https://github.com/actions/upload-artifact/issues/206)" > root.txt
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
name: dist-${{ matrix.workspace }}
path: | # Important to use `|` to preserve the path (see https://github.com/actions/upload-artifact/issues/55#issuecomment-633825395)
${{ matrix.workspace }}/dist/**
root.txt
root-${{ matrix-workspace }}.txt
if-no-files-found: error

test:
needs: build-app
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
- uses: actions/checkout@v4
- name: Cache build
id: cache-build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules/.cache/nx
key: ${{ runner.os }}-nx-${{ hashFiles('package-lock.json') }}
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'
Expand All @@ -111,10 +116,12 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
pattern: dist-*
merge-multiple: true
- run: |
cp -r server/dist/* docker/app/
cp -rT server/test-data/ docker/app/test-data/
Expand All @@ -126,17 +133,17 @@ jobs:
npm install
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-app
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: docker/app
push: true
Expand All @@ -160,10 +167,10 @@ jobs:
en_US
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-postgres
labels: |
Expand All @@ -178,13 +185,13 @@ jobs:
latest=auto
suffix=-${{ matrix.language }},onlatest=true
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
build-args: |
language=${{ matrix.language }}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 42cde13

Please sign in to comment.