Skip to content

Commit

Permalink
refactor!: move actions up to project root
Browse files Browse the repository at this point in the history
BREAKING CHANGE action path has been changed to remove `packages/`
  • Loading branch information
bryantbiggs committed Sep 24, 2020
1 parent 6595627 commit 7739e2e
Show file tree
Hide file tree
Showing 35 changed files with 83 additions and 66 deletions.
22 changes: 11 additions & 11 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@

Collection of GitHub actions for interacting with AWS services.

| Action | Local Action Tests |
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [`clowdhaus/aws-github-actions/packages/awscli@master`](../packages/awscli) | ![AWS Command Line Interface](https://github.com/clowdhaus/aws-github-actions/workflows/awscli/badge.svg) |
| [`clowdhaus/aws-github-actions/packages/cloudfront_invalidate@master`](../packages/cloudfront_invalidate) | ![CloudFront Invalidate](https://github.com/clowdhaus/aws-github-actions/workflows/CloudFront%20Invalidation/badge.svg) |
| [`clowdhaus/aws-github-actions/packages/iam_access_credentials@master`](../packages/iam_access_credentials) | ![IAM Access Credentials](https://github.com/clowdhaus/aws-github-actions/workflows/IAM%20Credentials/badge.svg) |
| [`clowdhaus/aws-github-actions/packages/s3_sync@master`](../packages/s3_sync) | ![S3 Sync](https://github.com/clowdhaus/aws-github-actions/workflows/S3%20Sync/badge.svg) |
| Action | Local Action Tests |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [`clowdhaus/aws-github-actions/awscli@master`](../awscli) | ![AWS Command Line Interface](https://github.com/clowdhaus/aws-github-actions/workflows/awscli/badge.svg) |
| [`clowdhaus/aws-github-actions/cloudfront_invalidate@master`](../cloudfront_invalidate) | ![CloudFront Invalidate](https://github.com/clowdhaus/aws-github-actions/workflows/CloudFront%20Invalidation/badge.svg) |
| [`clowdhaus/aws-github-actions/iam_access_credentials@master`](../iam_access_credentials) | ![IAM Access Credentials](https://github.com/clowdhaus/aws-github-actions/workflows/IAM%20Credentials/badge.svg) |
| [`clowdhaus/aws-github-actions/s3_sync@master`](../s3_sync) | ![S3 Sync](https://github.com/clowdhaus/aws-github-actions/workflows/S3%20Sync/badge.svg) |

## Usage

See individual action directory for details on usage and examples.

- [AWS Command Line Interface](../packages/awscli) - execute awscli commands
- [CloudFront Invalidate](../packages/cloudfront_invalidate) - invalidate AWS CloudFront distribution to force cache refresh
- [IAM Access Credentials](../packages/iam_access_credentials) - ensure GitHub actions workflow environment has necessary AWS IAM credentials available for subsequent AWS actions
- [S3 Sync](../packages/s3_sync) - synchronize local files to remote AWS S3 bucket
- [AWS Command Line Interface](../awscli) - execute awscli commands
- [CloudFront Invalidate](../cloudfront_invalidate) - invalidate AWS CloudFront distribution to force cache refresh
- [IAM Access Credentials](../iam_access_credentials) - ensure GitHub actions workflow environment has necessary AWS IAM credentials available for subsequent AWS actions
- [S3 Sync](../s3_sync) - synchronize local files to remote AWS S3 bucket

## Getting Started

Expand All @@ -50,7 +50,7 @@ See [here](https://yarnpkg.com/en/docs/install#debian-stable) for instructions o

`lerna` is used to managed the project as a monorepo - where each action is packaged and managed individually, and some packages are internal modules shared across the actions.

To install locally on your machine, it is recommended to install globally via npm or yarn:
To install locally on your machine, it is recommended to install globally via npm or yarn:

```bash
$ npm install lerna --globally
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/awscli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@ on:
branches:
- master
paths:
- 'packages/awscli/**'
- 'awscli/**'
- 'packages/awscli-core/**'
- 'package.json'
# pull_request:
# branches:
# - master
# paths:
# - 'packages/awscli/**'
# - 'packages/awscli-core/**'
# - 'package.json'

jobs:
awscli:
Expand All @@ -27,29 +20,29 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS Credentials
uses: ./packages/iam_access_credentials
uses: ./iam_access_credentials
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: List us-east-1 DHCP option set values w/ default json output
uses: ./packages/awscli
uses: ./awscli
with:
cli-command: ec2
cli-subcommand: describe-dhcp-options
cli-parameters: --query DhcpOptions[0].DhcpConfigurations[*].Values[0].Value
aws-region: us-east-1
- name: Get network interface subnet ID
id: net-int-subnet-id
uses: ./packages/awscli
uses: ./awscli
with:
cli-command: ec2
cli-subcommand: describe-network-interfaces
cli-options: --output text
cli-parameters: --query NetworkInterfaces[0].SubnetId
aws-region: us-east-1
- name: Describe interface subnet ID
uses: ./packages/awscli
uses: ./awscli
env:
ACTIONS_RUNNER_DEBUG: true
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cloudfront_invalidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
paths:
- 'packages/cloudfront_invalidate/**'
- 'cloudfront_invalidate/**'
- 'package.json'

jobs:
Expand All @@ -16,13 +16,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS Credentials
uses: ./packages/iam_access_credentials
uses: ./iam_access_credentials
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: CloudFront invalidation
uses: ./packages/cloudfront_invalidate
uses: ./cloudfront_invalidate
with:
distribution-id: EMKUWBIVAK6PF
paths: |
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/iam_access_credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ on:
branches:
- master
paths:
- 'packages/iam_access_credentials/**'
- 'iam_access_credentials/**'
- 'package.json'
# pull_request:
# branches:
# - master
# paths:
# - 'packages/iam_access_credentials/**'
# - 'package.json'

jobs:
s3-sync:
Expand All @@ -25,7 +19,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS Credentials
uses: ./packages/iam_access_credentials
uses: ./iam_access_credentials
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
push:
branches:
- master
paths:
- 'awscli/**'
- 'cloudfront_invalidate/**'
- 'iam_access_credentials/**'
- 'pacakges/**'
- 's3_sync/**'
- 'package.json'

jobs:
prTitle:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- run: yarn install
- run: yarn run build
- run: yarn run release
env:
GIT_AUTHOR_NAME: claus-cli
GIT_COMMITTER_NAME: claus-cli
GIT_AUTHOR_EMAIL: ${{ secrets.EMAIL }}
GIT_COMMITTER_EMAIL: ${{ secrets.EMAIL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 4 additions & 11 deletions .github/workflows/s3_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@ on:
branches:
- master
paths:
- 'packages/s3_sync/**'
- 's3_sync/**'
- 'packages/awscli-core/**'
- 'package.json'
# pull_request:
# branches:
# - master
# paths:
# - 'packages/s3_sync/**'
# - 'packages/awscli-core/**'
# - 'package.json'

jobs:
s3-sync:
Expand All @@ -27,15 +20,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS Credentials
uses: ./packages/iam_access_credentials
uses: ./iam_access_credentials
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Sync to S3
uses: ./packages/s3_sync
uses: ./s3_sync
with:
local-path: packages/s3_sync/dist
local-path: s3_sync/dist
bucket-name: github-actions-028920223318-us-east-1
path-prefix: my/new/prefix
args: --delete
File renamed without changes.
8 changes: 4 additions & 4 deletions packages/awscli/README.md → awscli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Reference - https://docs.aws.amazon.com/cli/latest/reference/index.html#cli-aws
## Usage

```yml
- uses: clowdhaus/aws-github-actions/packages/awscli@v0.4
- uses: clowdhaus/aws-github-actions/awscli@master
with:
# Command passed to awscli, which is infact the service that is the target of
# your invocation <i.e. - ec2, s3, ebs, etc.>
Expand Down Expand Up @@ -47,7 +47,7 @@ Reference - https://docs.aws.amazon.com/cli/latest/reference/index.html#cli-aws
### Execute describe style command with standard json result output

```yml
- uses: clowdhaus/aws-github-actions/packages/awscli@v0.4
- uses: clowdhaus/aws-github-actions/awscli@master
with:
cli-command: ec2
cli-subcommand: describe-dhcp-options
Expand All @@ -57,7 +57,7 @@ Reference - https://docs.aws.amazon.com/cli/latest/reference/index.html#cli-aws
### Execute describe style command with query and text output

```yml
- uses: clowdhaus/aws-github-actions/packages/awscli@v0.4
- uses: clowdhaus/aws-github-actions/awscli@master
with:
cli-command: ec2
cli-subcommand: describe-network-interfaces
Expand All @@ -69,7 +69,7 @@ Reference - https://docs.aws.amazon.com/cli/latest/reference/index.html#cli-aws
### Execute describe style command using output from a prior describe command of ID `net-int-subnet-id`

```yml
- uses: clowdhaus/aws-github-actions/packages/awscli@v0.4
- uses: clowdhaus/aws-github-actions/awscli@master
env:
ACTIONS_RUNNER_DEBUG: true
with:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions awscli/dist/index.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `cloudfront_invalidate` GitHub action creates an invalidation request for an
## Usage

```yml
- uses: clowdhaus/aws-github-actions/packages/cloudfront_invalidate@v0.4
- uses: clowdhaus/aws-github-actions/cloudfront_invalidate@master
with:
# The CloudFront distribution ID
# Required: true
Expand All @@ -39,15 +39,15 @@ The `cloudfront_invalidate` GitHub action creates an invalidation request for an
### Invalidate entire distribution

```yml
- uses: clowdhaus/aws-github-actions/packages/cloudfront_invalidate@v0.4
- uses: clowdhaus/aws-github-actions/cloudfront_invalidate@master
with:
distribution-id: E323PSTTFMI4A7
```

### Invalidate multiple paths

```yml
- uses: clowdhaus/aws-github-actions/packages/cloudfront_invalidate@v0.4
- uses: clowdhaus/aws-github-actions/cloudfront_invalidate@master
with:
distribution-id: E323PSTTFMI4A7
paths: |
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions cloudfront_invalidate/dist/index.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `iam_access_credentials` GitHub action will configure the workflow environme
## Usage

```yml
- uses: clowdhaus/aws-github-actions/packages/iam_access_credentials@v0.4
- uses: clowdhaus/aws-github-actions/iam_access_credentials@master
with:
# AWS Region to send the request to. If defined, this environment variable overrides
# the value for the profile setting region
Expand Down Expand Up @@ -62,7 +62,7 @@ The `iam_access_credentials` GitHub action will configure the workflow environme
### Standard setup of access credentials from GitHub secrets

```yml
- uses: clowdhaus/aws-github-actions/packages/iam_access_credentials@v0.4
- uses: clowdhaus/aws-github-actions/iam_access_credentials@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -72,7 +72,7 @@ The `iam_access_credentials` GitHub action will configure the workflow environme
### Use credentials from assumed IAM role

```yml
- uses: clowdhaus/aws-github-actions/packages/s3_sync@v0.4
- uses: clowdhaus/aws-github-actions/s3_sync@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -84,7 +84,7 @@ The `iam_access_credentials` GitHub action will configure the workflow environme
### Use credentials from assumed IAM role with external ID

```yml
- uses: clowdhaus/aws-github-actions/packages/s3_sync@v0.4
- uses: clowdhaus/aws-github-actions/s3_sync@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions iam_access_credentials/dist/index.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"homepage": "https://github.com/clowdhaus/aws-github-actions#readme",
"private": true,
"workspaces": [
"packages/*"
"awscli",
"cloudfront_invalidate",
"iam_access_credentials",
"packages/*",
"s3_sync"
],
"scripts": {
"build": "lerna run build && lerna run compile",
Expand Down
1 change: 0 additions & 1 deletion packages/awscli/dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/cloudfront_invalidate/dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/iam_access_credentials/dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/s3_sync/dist/index.js

This file was deleted.

File renamed without changes.
10 changes: 5 additions & 5 deletions packages/s3_sync/README.md → s3_sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Note: The sync action works on directories only, not individual files, and can b
## Usage

```yml
- uses: clowdhaus/aws-github-actions/packages/s3_sync@v0.4
- uses: clowdhaus/aws-github-actions/s3_sync@master
with:
# Path to local directory to synchronize, starting from project root directory
# Required: true
Expand All @@ -42,7 +42,7 @@ Note: The sync action works on directories only, not individual files, and can b
### Sync to root of S3 bucket

```yml
- uses: clowdhaus/aws-github-actions/packages/s3_sync@v0.4
- uses: clowdhaus/aws-github-actions/s3_sync@master
with:
local-path: dist/
bucket-name: my-s3-bucket
Expand All @@ -51,7 +51,7 @@ Note: The sync action works on directories only, not individual files, and can b
### Sync to S3 bucket prefix

```yml
- uses: clowdhaus/aws-github-actions/packages/s3_sync@v0.4
- uses: clowdhaus/aws-github-actions/s3_sync@master
with:
local-path: dist/
bucket-name: my-s3-bucket
Expand All @@ -61,7 +61,7 @@ Note: The sync action works on directories only, not individual files, and can b
### Sync to S3 bucket prefix & delete files not in source

```yml
- uses: clowdhaus/aws-github-actions/packages/s3_sync@v0.4
- uses: clowdhaus/aws-github-actions/s3_sync@master
with:
local-path: dist/
bucket-name: my-s3-bucket
Expand All @@ -75,7 +75,7 @@ Only syncs `*.js` files in `dist/` directory and delete those no longer found fr
Note: order of args dictates precedence - see [documentation](https://docs.aws.amazon.com/cli/latest/reference/s3/index.html#use-of-exclude-and-include-filters)

```yml
- uses: clowdhaus/aws-github-actions/packages/s3_sync@v0.4
- uses: clowdhaus/aws-github-actions/s3_sync@master
with:
local-path: dist/
bucket-name: my-s3-bucket
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions s3_sync/dist/index.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.

0 comments on commit 7739e2e

Please sign in to comment.