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

GitHub Actions #129

Merged
merged 2 commits into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI/CD
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Go Configuration
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Checkout code
uses: actions/checkout@v1

- name: Build
run: make

- name: Test
run: make native-test

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: quay-operator
path: build/_output/bin

latest-image:
name: Build Latest Image
runs-on: ubuntu-latest
if: "github.repository == 'redhat-cop/quay-operator' && !startsWith(github.ref, 'refs/tags') && github.ref == 'refs/heads/master'"
needs: ["build"]
steps:
- name: Check out code
uses: actions/checkout@v1

- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: quay-operator
path: build/_output/bin

- name: Build and Publish Latest Image
env:
DOCKER_USER: ${{ secrets.DockerUser }}
DOCKER_PASSWORD: ${{ secrets.DockerPassword }}
REPOSITORY: ${{ secrets.Repository }}
run: "make ci-latest-deploy"

release-image:
name: Build Release Image
runs-on: ubuntu-latest
if: "github.repository == 'redhat-cop/quay-operator' && startsWith(github.ref, 'refs/tags') && github.ref == 'refs/heads/master'"
needs: ["build"]
steps:
- name: Check Out Code
uses: actions/checkout@v1

- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: quay-operator
path: build/_output/bin

- name: Build and Publish Release Image
env:
DOCKER_USER: ${{ secrets.DockerUser }}
DOCKER_PASSWORD: ${{ secrets.DockerPassword }}
REPOSITORY: ${{ secrets.Repository }}
run: "make ci-latest-deploy"
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ docker-build:
docker-push:
docker push ${IMG}

# Travis Latest Tag Deployment
travis-latest-deploy: docker-login docker-build docker-push
# CI Latest Tag Deployment
ci-latest-deploy: docker-login docker-build docker-push
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sabre1041 Should this PR go ahead and remove the .travis.yml file as well since these make targets will no longer be available to it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kurtismullins I updated the PR to include travis and correct a few things. I havent had a chance to test the tag path fully, but since we arent planning a tag in the immediate, I'd like to get this out there


# Travis Dev Deployment
travis-dev-deploy: docker-login docker-build docker-push-dev
# CI Dev Deployment
ci-dev-deploy: docker-login docker-build docker-push-dev

# Travis Release
travis-release-deploy: docker-login docker-build docker-push-release
# CI Release
ci-release-deploy: docker-login docker-build docker-push-release
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# quay-operator

[![Build Status](https://travis-ci.org/redhat-cop/quay-operator.svg?branch=master)](https://travis-ci.org/redhat-cop/quay-operator) [![Docker Repository on Quay](https://quay.io/repository/redhat-cop/quay-operator/status "Docker Repository on Quay")](https://quay.io/repository/redhat-cop/quay-operator)
[![Build Status](https://github.com/redhat-cop/quay-operator/workflows/.github/workflows/ci.yml/badge.svg?branch=master)](https://github.com/redhat-cop/quay-operator/actions?workflow=CI%2FCD)
[![Docker Repository on Quay](https://quay.io/repository/redhat-cop/quay-operator/status "Docker Repository on Quay")](https://quay.io/repository/redhat-cop/quay-operator)

Operator to manage the lifecycle of [Quay](https://www.openshift.com/products/quay).

Expand Down