Skip to content

Commit

Permalink
Upgrade CI (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Nov 1, 2024
1 parent 272d90d commit caf3228
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,14 @@ env:
jobs:
test-and-build:
runs-on: ubuntu-latest
container:
image: node:22

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: corepack enable
- name: Get pnpm cache directory path
id: pnpm-cache-dir-path
run: echo "::set-output name=dir::$(pnpm store path)"
- uses: actions/cache@v3
id: pnpm-cache
- uses: actions/setup-node@v4
with:
path: ${{ steps.pnpm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
node-version: 22
cache: pnpm
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Test
Expand All @@ -40,13 +33,13 @@ jobs:
run: pnpm lint
- name: Build dist
run: pnpm build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
- name: Build docs
run: pnpm run docs
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: docs
path: docs/
Expand All @@ -59,32 +52,32 @@ jobs:
needs: test-and-build
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/download-artifact@v3
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: docs
path: docs/
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
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
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ EXPOSE 8080

# RUN apt-get install -y git-core

CMD node ./index.js
CMD ["node", "./index.js"]

0 comments on commit caf3228

Please sign in to comment.