From f2b3be6b285c0aca79e5b256a9cebd9c3542a832 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 9 Jun 2026 17:39:12 +0200 Subject: [PATCH] Modernize GitHub CI --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93e508f..ab819d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,28 +4,28 @@ on: push: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + jobs: Build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: 12 - - - id: cache-node-modules - name: Download cache - uses: actions/cache@v2 - with: - path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} + cache: yarn - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install + run: yarn install --frozen-lockfile - name: ESLint run: yarn lint @@ -37,28 +37,34 @@ jobs: run: yarn build - name: Upload build artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: build path: dist retention-days: 7 Docker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/master' + permissions: + contents: read + packages: write steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to the GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: target: app tags: ghcr.io/${{ github.repository }}:latest push: true cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest - cache-to: type=inline + cache-to: type=inline \ No newline at end of file