From ceedca4e271f974764968e17ad68dabcd3a80107 Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Tue, 23 May 2023 20:50:20 +0200 Subject: [PATCH 1/2] Update GitHub Actions - Use the newest versions to solve the deprecation warning - Remove the cache step as the newest go and node actions have built-in caching - Add the official actions@github.com email address --- .github/workflows/build.yaml | 19 +++++-------------- .github/workflows/docs.yaml | 2 +- .github/workflows/release.yaml | 19 +++++-------------- .github/workflows/test.yaml | 19 +++++-------------- 4 files changed, 16 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 25c50472..f9fc481f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,28 +6,19 @@ jobs: steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.19.x' - name: Install node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: '18' + cache: 'npm' + cache-dependency-path: './web/package-lock.json' - name: Checkout code - uses: actions/checkout@v2 - - - name: Cache Go and npm modules - uses: actions/cache@v3 - with: - path: | - ~/go/pkg/mod - ~/go/bin - ~/.npm - web/node_modules - key: ${{ runner.os }}-ntfy-${{ hashFiles('go.sum', 'web/package.lock') }} - restore-keys: ${{ runner.os }}-ntfy- + uses: actions/checkout@v3 - name: Install dependencies run: make build-deps-ubuntu diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2ba9b9c6..6991dea6 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -30,7 +30,7 @@ jobs: run: | cd build/ntfy-docs.github.io git config user.name "GitHub Actions Bot" - git config user.email "<>" + git config user.email "" git add docs/ git commit -m "Updated docs" git push origin main diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 32c14096..e6e30e0d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,28 +9,19 @@ jobs: steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.19.x' - name: Install node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: '18' + cache: 'npm' + cache-dependency-path: './web/package-lock.json' - name: Checkout code - uses: actions/checkout@v2 - - - name: Cache Go and npm modules - uses: actions/cache@v3 - with: - path: | - ~/go/pkg/mod - ~/go/bin - ~/.npm - web/node_modules - key: ${{ runner.os }}-ntfy-${{ hashFiles('go.sum', 'web/package.lock') }} - restore-keys: ${{ runner.os }}-ntfy- + uses: actions/checkout@v3 - name: Docker login uses: docker/login-action@v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index da7bcf5d..f04162c2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,28 +6,19 @@ jobs: steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.19.x' - name: Install node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: '18' + cache: 'npm' + cache-dependency-path: './web/package-lock.json' - name: Checkout code - uses: actions/checkout@v2 - - - name: Cache Go and npm modules - uses: actions/cache@v3 - with: - path: | - ~/go/pkg/mod - ~/go/bin - ~/.npm - web/node_modules - key: ${{ runner.os }}-ntfy-${{ hashFiles('go.sum', 'web/package.lock') }} - restore-keys: ${{ runner.os }}-ntfy- + uses: actions/checkout@v3 - name: Install dependencies run: make build-deps-ubuntu From 3f8784c8a87e4b5d0345a156bf91ad1b5e3bc254 Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Tue, 23 May 2023 21:03:58 +0200 Subject: [PATCH 2/2] Move checkout up since the cache needs lockfiles --- .github/workflows/build.yaml | 6 +++--- .github/workflows/release.yaml | 6 +++--- .github/workflows/test.yaml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f9fc481f..0076c0fa 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,6 +4,9 @@ jobs: build: runs-on: ubuntu-latest steps: + - + name: Checkout code + uses: actions/checkout@v3 - name: Install Go uses: actions/setup-go@v4 @@ -16,9 +19,6 @@ jobs: node-version: '18' cache: 'npm' cache-dependency-path: './web/package-lock.json' - - - name: Checkout code - uses: actions/checkout@v3 - name: Install dependencies run: make build-deps-ubuntu diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e6e30e0d..f709332a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,9 @@ jobs: release: runs-on: ubuntu-latest steps: + - + name: Checkout code + uses: actions/checkout@v3 - name: Install Go uses: actions/setup-go@v4 @@ -19,9 +22,6 @@ jobs: node-version: '18' cache: 'npm' cache-dependency-path: './web/package-lock.json' - - - name: Checkout code - uses: actions/checkout@v3 - name: Docker login uses: docker/login-action@v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f04162c2..7473567b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,6 +4,9 @@ jobs: test: runs-on: ubuntu-latest steps: + - + name: Checkout code + uses: actions/checkout@v3 - name: Install Go uses: actions/setup-go@v4 @@ -16,9 +19,6 @@ jobs: node-version: '18' cache: 'npm' cache-dependency-path: './web/package-lock.json' - - - name: Checkout code - uses: actions/checkout@v3 - name: Install dependencies run: make build-deps-ubuntu