-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 82ecb86
Showing
5 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 HeroDevs | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Shareable Github Actions | ||
|
||
The actions defined in this repository can be reused across all of the NES github organization. | ||
|
||
- [Init](#init) | ||
- [Cache](#cache) | ||
- [Uncache](#uncache) | ||
|
||
## Init | ||
|
||
This action will: | ||
|
||
- authenticate with github | ||
- checkout the code from the repo | ||
- initialize node | ||
|
||
``` | ||
- name: init | ||
uses: neverendingsupport/actions/init@v1 | ||
with: | ||
node-version: 18 | ||
``` | ||
|
||
## Cache | ||
|
||
### Inputs | ||
|
||
`job` - The name of the current job in which you wish to cache | ||
NOTE - this is used to build the key name of the cache being created | ||
|
||
### Usage | ||
``` | ||
- name: cache | ||
uses: neverendingsupport/actions/cache@v1 | ||
with: | ||
job: [JOB_NAME] | ||
``` | ||
|
||
## Uncache | ||
|
||
### Inputs | ||
|
||
`job-name` - The name of the job in which you wish to restore from. | ||
|
||
### Usage | ||
``` | ||
- name: uncache | ||
uses: neverendingsupport/actions/uncache@v1 | ||
with: | ||
from-job: [JOB_NAME] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: 'Cache' | ||
description: 'Cache the workspace' | ||
inputs: | ||
job: | ||
description: 'job name' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: save full cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: '.' | ||
key: ${{ github.ref_name }}-${{ inputs.job }}-${{ github.run_id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'Initialize' | ||
description: 'Initialize the workspace (checkout, auth, setup node)' | ||
inputs: | ||
node-version: | ||
description: 'The version of node to use (default: 20)' | ||
required: false | ||
default: 20 | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# Checkout/get the latest code | ||
- uses: actions/checkout@v3 | ||
|
||
# Authenticate | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Set up node with the specified version | ||
- uses: actions/setup-node@v3 v${{ inputs.node-version }} | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
registry-url: https://npm.pkg.github.com | ||
scope: "@neverendingsupport" | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: 'Uncache' | ||
description: 'Uncaches the workspace' | ||
inputs: | ||
from-job: | ||
description: 'job name to restore from' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: restore full cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: '.' | ||
key: ${{ github.ref_name }}-${{ inputs.from-job }}-${{ github.run_id }} |