Skip to content

Instantly share code, notes, and snippets.

FROM python:3-slim AS builder
ADD . /app
WORKDIR /app
# We are installing a dependency here directly into our app source dir
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip install --target=/app -r requirements.txt
# A distroless container image with Python and some basics like SSL certificates
# -*- coding: utf-8 -*-
"""This module contains the code that executes the github action."""
import os
def main():
"""Greet user using the supplied name."""
my_input = os.getenv('INPUT_MYINPUT') or 'world'
my_output = f"Hello {my_input}"
on: [push]
jobs:
hello_world_job:
runs-on: ubuntu-latest
name: A job to say hello
steps:
- name: Hello world action step
id: hello
uses: twyle/[email protected]
# oryks-code-coverage
This action prints "Hello World" or "Hello" + the name of a person to greet to the log.
## Inputs
## `who-to-greet`
**Required** The name of the person to greet. Default `"World"`.
#!/bin/sh -l
echo "Hello $1"
time=$(date)
echo "::set-output name=time::$time"
# action.yml
name: 'Hello World'
description: 'Greet someone and record the time'
inputs:
who-to-greet: # id of input
description: 'Who to greet'
required: true
default: 'World'
outputs:
time: # id of output
# Container image that runs your code
FROM alpine:3.10
# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
# -*- coding: utf-8 -*-
"""Commands used to start and test the application."""
from flask.cli import FlaskGroup
from API import app
cli = FlaskGroup(app)
if __name__ == '__main__':
cli()
CLIENT_ID=xxxxxxxxxxxxxxxxxxxxx
CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxx
FLASK_APP=API/__init__.py
FLASK_ENV=development