Code Monkey home page Code Monkey logo

cicd's Introduction

CICD

This repository contains shared GitHub workflows and shared (generic) Dockerfiles to be used by your CICD.

GitHub Workflows

The Docker workflow

The Docker workflow allows to build, tag and push Docker images from a GitHub action in just a few lines.

Usage

Create a GitHub workflow (.yml file) in .github/workflows as you usualy do. Then, use the docker-workflow from this repository thanks to the uses keyword.

Here is a working example:

name: docker

on:
  push:
    branches:
      - 'main'
    tags:
      - 'v*'

jobs:
  docker:
    uses: onlydustxyz/cicd/.github/workflows/docker-workflow.yml@main
    with:
      image_name: od-badge-signup
      image_tag: ${{ github.ref_name }}
      dockerfile: rocket-rs
      datadog_label: '[{"source": "deathnote", "service": "od-badge-signup"}]'
    secrets: inherit

Inputs

  • image_name is required. It corresponds to the name of the docker image that will be built.
  • image_tag is required. It is the tag of the docker image.
  • dockerfile is not required. This allows to use Dockerfiles from this repository (eg. rocket-rs). If not set, your repository must contain a Dockerfile at the root directory.
  • datadog_label is not required. It will be passed as a build argument named DATADOG_LABEL to the Dockerfile (see example).

Secrets

It expects the following secrets to be set, which should be already the case in our GitHub organisation:

  • DOCKERHUB_USERNAME
  • DOCKERHUB_TOKEN
  • DOCKER_REGISTRY

Dockerfiles

Dockerfile rocket-rs

This is a generic Dockerfile meant to be used for Rust applications that use the Rocket web framework.

Note: make sure the app binary is named "service" by adding those 3 lines to Cargo.toml:

[[bin]]
name = "service"
path = "src/main.rs"

cicd's People

Contributors

ofux avatar

Watchers

 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.