Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ebronson68 committed Jul 7, 2023
1 parent 59103f4 commit bad2de1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 22 deletions.
7 changes: 4 additions & 3 deletions .github/.templatesyncignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.ps1
README.md
Secrets-example.json
.github/CODEOWNERS
.github/workflows/template-sync.yml
action.yaml
README.md
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General
* @Andrews-McMeel-Universal/devops-engineers
* @Andrews-McMeel-Universal/devops-engineers @Andrews-McMeel-Universal/front-end-engineers

# Front-end Engineering
# *.html @Andrews-McMeel-Universal/front-end-engineers
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/template-sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🔄 Sync with .github repository
name: 🔄 Sync with action_template repository

on:
schedule:
Expand All @@ -24,11 +24,11 @@ jobs:
uses: AndreasAugustin/[email protected]
with:
github_token: ${{ secrets.PAT_ACTION_CI }}
source_repo_path: Andrews-McMeel-Universal/.github
source_repo_path: Andrews-McMeel-Universal/action_template
upstream_branch: main
pr_labels: maintenance
pr_commit_msg: 🔄 Synchronize with @Andrews-McMeel-Universal/.github
pr_title: 🔄 Sync with @Andrews-McMeel-Universal/.github
pr_commit_msg: 🔄 Synchronize with @Andrews-McMeel-Universal/action_template
pr_title: 🔄 Sync with @Andrews-McMeel-Universal/action_template
pr_branch_name_prefix: sync/dotgithub/
is_dry_run: ${{ inputs.isdryrun || 'false' }}
git_user_name: amutechtest
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
# Action Template
# Cache Next Build Action

GitHub action to echo "Hello World"

Template repository for reusable GitHub actions

You can use this guide to figure out how to update your application using the template: [Creating a new repository from a template](https://amuniversal.atlassian.net/wiki/spaces/TD/pages/3419832336/Creating+a+New+GitHub+Repository#Creating-a-new-repository-from-a-template)
GitHub action to install Node dependencies and cache the result

## Getting Started

```bash
git clone https://github.com/Andrews-McMeel-Universal/action_template
git clone https://github.com/Andrews-McMeel-Universal/cache-next-build
```

## Installation

To make `action_template` a part of your workflow, just add a step to one of your workflows in your `.github/workflows/` directory in your GitHub repository.
To make `cache-next-build` a part of your workflow, just add a step to one of your workflows in your `.github/workflows/` directory in your GitHub repository.

## Options

| Variable | Description | Required | `[Default]` |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | ------------------------------------- |
| `input` | Input Description | x | `Default Value` |
| `N/A` | N/A | N/A | `N/A` |
23 changes: 18 additions & 5 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
name: Default GitHub Action
name: Cache Next Build

description: Default GitHub Action that outputs "Hello World"
description: Builds the Next.js app and caches the result

branding:
color: purple
icon: unlock
color: yellow
icon: cpu
runs:
using: "composite"
steps:
- run: echo "Hello World" >> $GITHUB_OUTPUT
- name: Cache build
id: build-cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.next
key: build-${{ hashFiles('**/.env','**/*.lock','**/*.[jt]s*') }}

# Builds the app if the cache was broken
# NOTE: The .env file is added as a path to the build-cache so when
# yarn build runs, it will have the proper environment variables
- name: Build app
if: steps.build-cache.outputs.cache-hit != 'true'
run: yarn build
shell: bash

0 comments on commit bad2de1

Please sign in to comment.