Skip to content

Commit

Permalink
chore: add composite bootstrap action
Browse files Browse the repository at this point in the history
  • Loading branch information
samhamptonheycar committed Mar 22, 2024
1 parent 5fb1af0 commit 9b776b0
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 193 deletions.
6 changes: 3 additions & 3 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
repository:
name: actions-template
name: action=bootstrap
description: |
A Github template repo for public Gh Actions
topics: github, actions, ci, scripts
A Github action to perform common tasks for build pipelines.
topics: github, actions, ci, scripts, ecr, docker
default_branch: master

private: true
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: test

on:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: build
uses: ./
with:
ecr-repo-name: intercontinental
21 changes: 0 additions & 21 deletions Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# actions-template
# action-bootstrap

Template repo for github actions
A Github action to perform common tasks for build pipelines
61 changes: 30 additions & 31 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
name: Some action # TODO(user): Replace this with your action name
name: Action Bootstrap
branding:
icon: arrow-right-circle
color: gray-dark
description: | # TODO(user): replace this with your action description
This action does something
description: |
This action performs git repo checkout, configures AWS credentials, logs into ECR and generates the image name
inputs:
debug-mode:
description: Set to true for verbose execution when debugging
required: false
default: 'false'
log-level:
description: The log level to use for the execution
required: false
default: 'info'
log-timestamped:
description: Set to true in order to enable timestamps on log messages
required: false
default: 'true'
# TODO(user): Specify your inputs here
input-name:
description: Some input description
ecr-repo-name:
required: true

# TODO(user): Define your outputs here
outputs:
some-output:
description: 'Some output description'

runs:
using: 'docker'
image: Dockerfile
env:
DEBUG_MODE: ${{ inputs.debug-mode }}
LOG_LEVEL: ${{ inputs.log-level }}
LOG_TIMESTAMPED: ${{ inputs.log-timestamped }}
# TODO(user): Define your environment variables here
SOME_INPUT: ${{ inputs.input-name }}
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_OPS_GH_CI }}
role-session-name: ${{ secrets.AWS_OPS_SESSION_NAME }}
aws-region: ${{ secrets.AWS_OPS_DEFAULT_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Image Name
id: img-name
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "ecr-repo-name=${{secrets.AWS_OPS_ACCOUNT_ID}}.dkr.ecr.${{ secrets.AWS_OPS_DEFAULT_REGION }}.amazonaws.com/alpha-image/${{ env.ECR_REPO_NAME }}" >>"${GITHUB_OUTPUT}"
else
echo "ecr-repo-name=${{secrets.AWS_OPS_ACCOUNT_ID}}.dkr.ecr.${{ secrets.AWS_OPS_DEFAULT_REGION }}.amazonaws.com/image/${{ env.ECR_REPO_NAME }}" >>"${GITHUB_OUTPUT}"
fi
env:
ECR_REPO_NAME: ${{ inputs.ecr-repo-name }}
25 changes: 0 additions & 25 deletions scripts/script.sh

This file was deleted.

111 changes: 0 additions & 111 deletions scripts/utils.sh

This file was deleted.

0 comments on commit 9b776b0

Please sign in to comment.