GRN2-346: Move cd from travis to github (#2498)

* Move cd from travis to github

* Fix build args
This commit is contained in:
Ahmad Farhat
2021-02-01 18:02:23 -05:00
committed by GitHub
parent 629dd7037a
commit 422ded1d3b
3 changed files with 62 additions and 16 deletions

30
.github/workflows/cd-push.yml vendored Normal file
View File

@ -0,0 +1,30 @@
env:
RUBY_VERSION: 2.7.2
name: CD
on:
push:
branches: "master"
jobs:
main:
name: Build Docker Image
runs-on: ubuntu-18.04
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push latest
uses: docker/build-push-action@v2
with:
push: true
tags: greenlight:latest
build-args: version_code=${GITHUB_SHA::8}

32
.github/workflows/cd-release.yml vendored Normal file
View File

@ -0,0 +1,32 @@
env:
RUBY_VERSION: 2.7.2
name: CD
on:
release:
jobs:
main:
name: Build Docker Image
runs-on: ubuntu-18.04
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push release
uses: docker/build-push-action@v2
with:
push: true
tags: |
greenlight:latest
greenlight:v2
greenlight:${GITHUB_REF}
build-args: version_code=${GITHUB_REF##*/release-}