Skip to content

Commit

Permalink
Merge pull request #5 from RockefellerArchiveCenter/development
Browse files Browse the repository at this point in the history
Add GitHub workflows
  • Loading branch information
p-galligan authored Nov 15, 2024
2 parents 1afbabb + df89b8a commit c21b682
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 39 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy

on:
push:
branches:
- base

jobs:
deploy:
runs-on: ubuntu-latest

environment:
name: ${{ github.ref_name }}

env:
LAMBDA_NAME: digitized_image_notifications
LAMBDA_HANDLER_CODE: src/handle_digitized_image_notifications.py
BASENAME: handle_digitized_image_notifications.py

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Export secrets to environment variables
uses: oNaiPs/[email protected]
with:
secrets: ${{ toJSON(secrets) }}

- name: Make zip file
run: |
cp ${{ env.LAMBDA_HANDLER_CODE }} ${{ env.BASENAME }}
zip ${{ env.LAMBDA_NAME }}.zip ${{ env.BASENAME }}
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
role-skip-session-tagging: true
role-duration-seconds: 900

- name: Upload file to S3
run: aws s3 cp $LAMBDA_NAME.zip s3://$LAMBDA_BUCKET_NAME/$LAMBDA_NAME.zip

- name: Deploy lambda package
run: aws lambda update-function-code
--function-name arn:aws:lambda:$AWS_REGION:${{ secrets.AWS_LAMBDA_ACCOUNT_ID }}:function:$LAMBDA_NAME
--zip-file fileb://$LAMBDA_NAME.zip
16 changes: 16 additions & 0 deletions .github/workflows/enforcer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Check Branch'

on:
pull_request:
branches:
- base

jobs:
check_branch:
runs-on: ubuntu-latest
steps:
- name: Check branch
if: github.head_ref != 'development'
run: |
echo "ERROR: You can only merge to base from the development branch."
exit 1
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests

on:
pull_request:
branches:
- development

jobs:
build:
runs-on: ubuntu-latest

environment:
name: development

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: pip install tox

- name: Run tests
run: tox
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# digitized_image_notifications
Handles notifications for validation and packaging of incoming digitized still image and textual assets.

[![Build Status](https://app.travis-ci.com/RockefellerArchiveCenter/digitized_image_notifications.svg?branch=base)](https://app.travis-ci.com/RockefellerArchiveCenter/digitized_image_notifications)

## Getting Started

With [git](https://git-scm.com/) installed, pull down the source code and move into the newly created directory:
Expand Down

0 comments on commit c21b682

Please sign in to comment.