From a45676cd99df6bd5fd53488c45c5591b7329ca83 Mon Sep 17 00:00:00 2001 From: Andrew Block Date: Sun, 5 Jan 2020 21:30:26 -0600 Subject: [PATCH 1/2] GitHub Actions --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ Makefile | 12 +++---- README.md | 3 +- 3 files changed, 79 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..54bc9940a --- /dev/null +++ b/.github/workflows/ci.yml @@ -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" diff --git a/Makefile b/Makefile index bd34cf62f..143ce67dc 100644 --- a/Makefile +++ b/Makefile @@ -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 -# 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 \ No newline at end of file +# CI Release +ci-release-deploy: docker-login docker-build docker-push-release \ No newline at end of file diff --git a/README.md b/README.md index a84a360dc..3b0e41785 100644 --- a/README.md +++ b/README.md @@ -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). From 7d5b123486434bb7c303472a67395a2a04b346eb Mon Sep 17 00:00:00 2001 From: Andrew Block Date: Mon, 13 Jan 2020 15:52:29 -0600 Subject: [PATCH 2/2] Updated GH action and removed travis file --- .github/workflows/ci.yml | 2 +- .travis.yml | 30 ------------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54bc9940a..c14f50841 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,4 +68,4 @@ jobs: DOCKER_USER: ${{ secrets.DockerUser }} DOCKER_PASSWORD: ${{ secrets.DockerPassword }} REPOSITORY: ${{ secrets.Repository }} - run: "make ci-latest-deploy" + run: "make ci-release-deploy" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8eb7fce45..000000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: required -language: go -go_import_path: github.com/redhat-cop/quay-operator -go: - - "1.13" - -env: - - GO111MODULE=on - -deploy: - - provider: script - skip_cleanup: true - script: make travis-latest-deploy - on: - repo: redhat-cop/quay-operator - branch: master - tags: false - - provider: script - skip_cleanup: true - script: make travis-release-deploy - on: - repo: redhat-cop/quay-operator - branch: master - tags: true - - provider: script - skip_cleanup: true - script: make travis-dev-deploy DEV_TAG=$TRAVIS_COMMIT - on: - condition: $PUSH_LATEST_COMMIT = yes - all_branches: true