Skip to content

Commit 06f62e7

Browse files
authored
Merge pull request #135 from jaredwray/chore-updating-all-github-actions
chore: updating all github actions
2 parents 90d0ff7 + 26d8853 commit 06f62e7

6 files changed

Lines changed: 213 additions & 164 deletions

File tree

.github/workflows/code-coverage.yaml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,31 @@ name: code-coverage
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ main ]
6+
branches: [main]
77
pull_request:
8-
branches: [ main ]
8+
branches: [main]
99

1010
permissions:
1111
contents: read
1212

1313
jobs:
1414
build:
15-
1615
runs-on: ubuntu-latest
1716

1817
steps:
19-
- uses: actions/checkout@v4
20-
- name: Use Node.js 24
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 24
24-
25-
- name: Install Dependencies
26-
run: npm install pnpm -g && pnpm install
27-
28-
- name: Build
29-
run: pnpm build
30-
31-
- name: Testing
32-
run: pnpm test
33-
34-
- name: Code Coverage
35-
uses: codecov/codecov-action@v5
36-
with:
37-
token: ${{ secrets.CODECOV_TOKEN }}
38-
files: ./coverage/lcov.info
39-
18+
- uses: actions/checkout@v5
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
version: 10
22+
- uses: actions/setup-node@v5
23+
with:
24+
node-version: 24
25+
cache: 'pnpm'
26+
- run: pnpm install --frozen-lockfile
27+
- run: pnpm build
28+
- run: pnpm test
29+
- name: Code Coverage
30+
uses: codecov/codecov-action@v5
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }}
33+
files: ./coverage/lcov.info

.github/workflows/codeql.yaml

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
12-
name: "codeql"
1+
name: codeql
132

143
on:
154
push:
16-
branches: [ "main" ]
5+
branches: ["main"]
176
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
7+
branches: ["main"]
208

219
jobs:
2210
analyze:
@@ -30,43 +18,21 @@ jobs:
3018
strategy:
3119
fail-fast: false
3220
matrix:
33-
language: [ 'javascript' ]
34-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
35-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
21+
language: ['javascript']
3622

3723
steps:
38-
- name: Checkout repository
39-
uses: actions/checkout@v3
24+
- name: Checkout repository
25+
uses: actions/checkout@v5
4026

41-
# Initializes the CodeQL tools for scanning.
42-
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v2
44-
with:
45-
languages: ${{ matrix.language }}
46-
# If you wish to specify custom queries, you can do so here or in a config file.
47-
# By default, queries listed here will override any specified in a config file.
48-
# Prefix the list here with "+" to use these queries and those in the config file.
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v3
29+
with:
30+
languages: ${{ matrix.language }}
4931

50-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
51-
# queries: security-extended,security-and-quality
32+
- name: Autobuild
33+
uses: github/codeql-action/autobuild@v3
5234

53-
54-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v2
58-
59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
61-
62-
# If the Autobuild fails above, remove it and uncomment the following three lines.
63-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
64-
65-
# - run: |
66-
# echo "Run, Build Application using script"
67-
# ./location_of_script_within_repo/buildscript.sh
68-
69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v2
71-
with:
72-
category: "/language:${{matrix.language}}"
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v3
37+
with:
38+
category: "/language:${{ matrix.language }}"

.github/workflows/deploy-site.yaml

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: deploy-site
33
on:
44
workflow_dispatch:
55
release:
6-
types: [ released ]
6+
types: [released]
77

88
permissions:
99
contents: read
@@ -13,37 +13,64 @@ env:
1313
SERVICE_NAME: mockhttp
1414

1515
jobs:
16-
setup-build-deploy:
17-
name: Setup and Deploy to Prod
16+
test:
17+
name: Test
1818
runs-on: ubuntu-latest
19-
2019
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v4
23-
24-
# Setup Node
25-
- name: Use Node.js
26-
uses: actions/setup-node@v4
20+
- uses: actions/checkout@v5
21+
- uses: pnpm/action-setup@v4
22+
with:
23+
version: 10
24+
- uses: actions/setup-node@v5
2725
with:
2826
node-version: 24
27+
cache: 'pnpm'
28+
- run: pnpm install --frozen-lockfile
29+
- run: pnpm test:ci
2930

30-
# DO NOT USE pnpm here, it will cause issues with Docker build
31-
- name: Install Dependencies
32-
run: npm install -g pnpm && pnpm install
31+
build:
32+
name: Build
33+
needs: test
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v5
37+
- uses: pnpm/action-setup@v4
38+
with:
39+
version: 10
40+
- uses: actions/setup-node@v5
41+
with:
42+
node-version: 24
43+
cache: 'pnpm'
44+
- run: pnpm install --frozen-lockfile
45+
- run: pnpm build
46+
- uses: actions/upload-artifact@v4
47+
with:
48+
name: dist
49+
path: dist/
50+
if-no-files-found: error
51+
retention-days: 1
52+
53+
deploy:
54+
name: Deploy to Production
55+
needs: build
56+
runs-on: ubuntu-latest
57+
environment: production
58+
steps:
59+
- uses: actions/checkout@v5
3360

34-
- name: Build
35-
run: pnpm build
61+
- uses: actions/download-artifact@v4
62+
with:
63+
name: dist
64+
path: dist/
3665

37-
# Setup gcloud CLI
3866
- name: Authenticate with Google Cloud
39-
uses: 'google-github-actions/auth@v2'
67+
uses: google-github-actions/auth@v3
4068
with:
4169
credentials_json: ${{ secrets.GCP_SA_KEY }}
4270

43-
- name: 'Set up Cloud SDK'
44-
uses: 'google-github-actions/setup-gcloud@v2'
71+
- name: Set up Cloud SDK
72+
uses: google-github-actions/setup-gcloud@v3
4573

46-
# Build and push image to Google Container Registry
4774
- name: Docker Auth
4875
run: gcloud auth configure-docker
4976

@@ -54,32 +81,25 @@ jobs:
5481
run: docker push gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA
5582

5683
- name: Make deploy-region.sh executable
57-
run: chmod +x ./scripts/deploy-region.sh
84+
run: chmod +x ./scripts/deploy-region.sh
5885

59-
# Deploy image to Cloud Run
6086
- name: Deploy to [us-central1]
6187
run: ./scripts/deploy-region.sh us-central1
6288

63-
# Deploy image to Cloud Run
6489
- name: Deploy to [us-west1]
6590
run: ./scripts/deploy-region.sh us-west1
6691

67-
# Deploy image to Cloud Run
6892
- name: Deploy to [us-east1]
6993
run: ./scripts/deploy-region.sh us-east1
7094

71-
# Deploy image to Cloud Run
7295
- name: Deploy to [europe-west1]
7396
run: ./scripts/deploy-region.sh europe-west1
7497

75-
# Deploy image to Cloud Run
7698
- name: Deploy to [europe-west3]
7799
run: ./scripts/deploy-region.sh europe-west3
78100

79-
# Deploy image to Cloud Run
80101
- name: Deploy to [asia-northeast1]
81102
run: ./scripts/deploy-region.sh asia-northeast1
82103

83-
# Deploy image to Cloud Run
84104
- name: Deploy to [asia-southeast1]
85-
run: ./scripts/deploy-region.sh asia-southeast1
105+
run: ./scripts/deploy-region.sh asia-southeast1
Lines changed: 63 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,74 @@
11
name: docker-publish
22

33
on:
4-
workflow_dispatch:
5-
release:
6-
types: [released]
4+
workflow_dispatch:
5+
release:
6+
types: [released]
77

88
permissions:
99
contents: read
1010

1111
jobs:
12-
build-and-push:
12+
test:
13+
name: Test
1314
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
- uses: pnpm/action-setup@v4
18+
with:
19+
version: 10
20+
- uses: actions/setup-node@v5
21+
with:
22+
node-version: 24
23+
cache: 'pnpm'
24+
- run: pnpm install --frozen-lockfile
25+
- run: pnpm test:ci
26+
27+
build:
28+
name: Build
29+
needs: test
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v5
33+
- uses: pnpm/action-setup@v4
34+
with:
35+
version: 10
36+
- uses: actions/setup-node@v5
37+
with:
38+
node-version: 24
39+
cache: 'pnpm'
40+
- run: pnpm install --frozen-lockfile
41+
- run: pnpm build
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: dist
45+
path: dist/
46+
if-no-files-found: error
47+
retention-days: 1
1448

49+
publish:
50+
name: Publish to Docker Hub
51+
needs: build
52+
runs-on: ubuntu-latest
53+
environment: docker
1554
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v4
55+
- uses: actions/checkout@v5
1856

19-
- name: Install Node.js
20-
uses: actions/setup-node@v4
57+
- uses: pnpm/action-setup@v4
2158
with:
22-
node-version: 24
59+
version: 10
2360

24-
- name: Install pnpm
25-
run: npm install -g pnpm && pnpm install
61+
- uses: actions/setup-node@v5
62+
with:
63+
node-version: 24
64+
cache: 'pnpm'
2665

66+
- run: pnpm install --frozen-lockfile
2767

28-
- name: Build
29-
run: pnpm build
68+
- uses: actions/download-artifact@v4
69+
with:
70+
name: dist
71+
path: dist/
3072

3173
- name: Set version variable
3274
run: |
@@ -42,21 +84,20 @@ jobs:
4284
- name: Build Docker Image
4385
run: docker build -t jaredwray/mockhttp:${{ env.VERSION }} -t jaredwray/mockhttp:latest .
4486

45-
- name: Build and push Docker image as SHA
87+
- name: Push Docker image (version)
4688
run: docker push docker.io/jaredwray/mockhttp:${{ env.VERSION }}
4789

48-
- name: Build and push Docker image as Latest
90+
- name: Push Docker image (latest)
4991
run: docker push docker.io/jaredwray/mockhttp:latest
5092

5193
- name: Build Docker Markdown
5294
run: pnpm docker:readme
5395

54-
# Update Docker Hub description
5596
- name: Update Docker Hub description
56-
uses: peter-evans/dockerhub-description@v2
97+
uses: peter-evans/dockerhub-description@v4
5798
with:
58-
username: ${{ secrets.DOCKER_USERNAME }}
59-
password: ${{ secrets.DOCKER_PASSWORD }}
60-
repository: jaredwray/mockhttp
61-
short-description: ${{ github.event.repository.description }}
62-
readme-filepath: ./DOCKER.md
99+
username: ${{ secrets.DOCKER_USERNAME }}
100+
password: ${{ secrets.DOCKER_PASSWORD }}
101+
repository: jaredwray/mockhttp
102+
short-description: ${{ github.event.repository.description }}
103+
readme-filepath: ./DOCKER.md

0 commit comments

Comments
 (0)