Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeing if safecast_deployer can be a github action #8

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.gitignore
.direnv
.envrc
.idea
10 changes: 10 additions & 0 deletions Dockerfile.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.8.5

COPY requirements.txt /
RUN pip install --upgrade pip &&\
pip install --use-feature=2020-resolver -r /requirements.txt

COPY safecast_deploy /safecast_deploy
COPY deploy.py /
COPY action.sh /
ENTRYPOINT ["bash", "/action.sh"]
4 changes: 4 additions & 0 deletions action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

exec ./deploy.py "${INPUT_MODE}" "${INPUT_APP}" "${INPUT_ENV}" "${INPUT_VERSION}"

20 changes: 20 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Safecast Deploy"
description: "Handles deployment operations for safecast environments"
inputs:
mode:
description: "Deploy mode (same_env,new_env)"
required: true
default: same_env
app:
description: 'Application: {api,ingest,reporting}'
required: true
env:
description: 'Env: {dev,prd}'
required: true
version:
description: 'App version'
required: true

runs:
using: 'docker'
image: 'docker://safecast/github-actions-safecast-deploy:v1'