Skip to content

Commit

Permalink
Bump node environment to 16.x
Browse files Browse the repository at this point in the history
- Bump setup-node action to v2.
- Use composite actions to reuse same setting. This is preferred over
  reusable templates because reusable templates are on job-level but
  setting up node should be a step.
  • Loading branch information
undergroundwires committed Mar 7, 2022
1 parent 05a6a84 commit 242a497
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 38 deletions.
8 changes: 8 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
runs:
using: composite
steps:
-
name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.x
8 changes: 2 additions & 6 deletions .github/workflows/checks.build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ jobs:
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./.github/actions/setup-node
-
name: Install dependencies
run: npm ci
Expand All @@ -42,9 +40,7 @@ jobs:
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./.github/actions/setup-node
-
name: Install dependencies
run: npm ci
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/checks.quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./.github/actions/setup-node
- name: Install dependencies
run: npm ci
- name: Lint
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/checks.security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ jobs:
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./.github/actions/setup-node
-
name: NPM audit
run: exit "$(npm audit)" # Since node 15.x, it does not fail with error if we don't explicitly exit
6 changes: 2 additions & 4 deletions .github/workflows/release.desktop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:
- name: Checkout to bump commit
run: git checkout "$(git rev-list "${{ github.event.release.tag_name }}"..master | tail -1)"
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./.github/actions/setup-node
- name: Install dependencies
run: npm ci
- name: Run unit tests
Expand All @@ -31,4 +29,4 @@ jobs:
run: npm run electron:build -- -p always # https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/recipes.html#upload-release-to-github
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EP_GH_IGNORE_TIME: true # Otherwise publishing fails if GitHub release is more than 2 hours old https://github.com/electron-userland/electron-builder/issues/2074
EP_GH_IGNORE_TIME: true # Otherwise publishing fails if GitHub release is more than 2 hours old https://github.com/electron-userland/electron-builder/issues/2074
18 changes: 8 additions & 10 deletions .github/workflows/release.site.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: release-site

on:
release:
types: [created] # will be triggered when a NON-draft release is created and published.
release:
types: [created] # will be triggered when a NON-draft release is created and published.

jobs:
aws-deploy: # see: https://github.com/undergroundwires/aws-static-site-with-cd
Expand Down Expand Up @@ -77,30 +77,28 @@ jobs:
name: "App: Checkout"
uses: actions/checkout@v2
with:
path: site
path: app
ref: master # otherwise we don't get version bump commit
-
name: "App: Setup node"
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./app/.github/actions/setup-node
-
name: "App: Install dependencies"
run: npm ci
working-directory: site
working-directory: app
-
name: "App: Run unit tests"
run: npm run test:unit
working-directory: site
working-directory: app
-
name: "App: Build"
run: npm run build
working-directory: site
working-directory: app
-
name: "App: Deploy to S3"
run: >-
bash "aws/scripts/deploy/deploy-to-s3.sh" \
--folder site/dist \
--folder app/dist \
--web-stack-name privacysexy-web-stack --web-stack-s3-name-output-name S3BucketName \
--storage-class ONEZONE_IA \
--role-arn ${{secrets.AWS_S3_SITE_DEPLOYMENT_ROLE_ARN}} \
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/tests.e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ jobs:
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./.github/actions/setup-node
-
name: Install dependencies
run: npm ci
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/tests.integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ jobs:
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
uses: ./.github/actions/setup-node
-
name: Install dependencies
run: npm ci
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/tests.unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
name: Checkout
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
name: Set-up node
uses: ./.github/actions/setup-node
-
name: Install dependencies
run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Everything that's merged in the master goes directly to production.

privacy.sexy uses [GitHub actions](https://github.com/features/actions) to define and run pipelines as code.

GitHub workflows i.e. pipelines exist in [`/.github/.workflows/`](./../.github/workflows/) folder without any subfolders due to GitHub actions requirements [1] .
GitHub workflows i.e. pipelines exist in [`/.github/workflows/`](./../.github/workflows/) folder without any subfolders due to GitHub actions requirements [1] .

[1]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows
Local GitHub actions are defined in [`/.github/actions/`](./../.github/actions/) and used to reuse same workflow steps.

## Pipeline types

Expand Down

0 comments on commit 242a497

Please sign in to comment.