Git Product home page Git Product logo

gha-workflows's Introduction

gha-workflows

Reusable Github Action Workflows

Examples:

Workflows

  • aws-deploy-ecs.yml:
name: Try workflow
on:
  push:
    branches:
      - try-workflow

jobs:
  try-workflow:
    uses: AuDigent/gha-workflows/.github/workflows/[email protected]
    with:
      ecr-repository-name: your-repo
      docker-image-tag: ${{ github.sha }}
      docker-build-platforms: linux/arm64
      environment: dev
      ecs-cluster: your-cluster
      ecs-service: your_service
      container-name: some-container
      aws-region: us-east-1
    secrets: inherit

Actions

  • build-and-push-to-ecr:
- uses: actions/checkout@v3
- name: Push Image to ECR
  uses: AuDigent/gha-workflows/.github/actions/[email protected]
  with:
    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    aws-region: us-east-1
    docker-image-tag: ${{ github.sha }}
    ecr-repository-name: my-repo
  • deploy-to-ecs:
- uses: actions/checkout@v3
- name: Deploy to ECS
  uses: AuDigent/gha-workflows/.github/actions/[email protected]
  with:
    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    aws-region: us-east-1
    ecs-cluster: your-cluster
    ecs-service: your_service
    docker-image: myregistry/myimage:tag
    container-name: my_container
  • get-codeartifact-token:
- uses: actions/checkout@v3
- name: Get CodeArtifact Token
  id: token
  uses: AuDigent/gha-workflows/.github/actions/[email protected]
  with:
    domain: my-domain
    domain-owner: 1111111   # Your AWS Account ID
    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- uses: actions/setup-python@v4
  with:
    python-version: '3.9'
    cache: 'pipenv'
- name: install dependencies
  env:
    CODEARTIFACT_AUTH_TOKEN: ${{ steps.token.outputs.token }}
  run: |
    pip install pipenv
    pipenv install --dev --ignore-pipfile

Example of pipenv config:

[[source]]
name = "aws"
url = "https://aws:${CODEARTIFACT_AUTH_TOKEN}@xxxxxx.d.codeartifact.us-east-1.amazonaws.com/pypi/xxxxx/simple/"
verify_ssl = true

[packages]
your-package = { version = "~=1.0", index = "aws" }

Example of IAM Policies to grant access to the repositories available here

gha-workflows's People

Contributors

mspiegelman avatar simonc-audigent avatar

Watchers

Matt Griffiths avatar jcbloch avatar Alex Shamray avatar Mark Shiffer avatar Abhinav avatar Dan O'Hara avatar Elli Scharlin avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.