diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4b76366c..87a08363 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,11 +3,7 @@ name: Continuous Integration on: push: branches: - - '**' - # - $default-branch - pull_request: - branches: - - '**' + - 'edi-foundation-integration' # - $default-branch jobs: @@ -60,3 +56,14 @@ jobs: - name: Docker Build run: | make docker + + - name: Docker login + run: | + docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + + - name: Docker tag & Push + run: | + docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest '${{ secrets.DOCKER_REPO }}'/edi-foundation-oauth2-proxy:${{ github.sha }} + docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest '${{ secrets.DOCKER_REPO }}'/edi-foundation-oauth2-proxy:latest + docker push '${{ secrets.DOCKER_REPO }}'/edi-foundation-oauth2-proxy:${{ github.sha }} + docker push '${{ secrets.DOCKER_REPO }}'/edi-foundation-oauth2-proxy:latest diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 00000000..6f4b3cf0 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,64 @@ +name: PR + +on: + pull_request: + branches: + - 'edi-foundation-integration' + # - $default-branch + +jobs: + build: + env: + COVER: true + runs-on: ubuntu-20.04 + steps: + + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16.x + id: go + + - name: Get dependencies + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + - name: Verify Code Generation + run: | + make verify-generate + - name: Lint + run: | + make lint + - name: Build + run: | + make build + - name: Test + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + run: | + ./.github/workflows/test.sh + docker: + runs-on: ubuntu-20.04 + steps: + + - name: Check out code + uses: actions/checkout@v2 + + - name: Docker Build + run: | + make docker + + - name: Docker login + run: | + docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + + - name: Docker tag & Push + run: | + docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest '${{ secrets.DOCKER_REPO }}'/edi-foundation-oauth2-proxy:prlatest + docker push '${{ secrets.DOCKER_REPO }}'/edi-foundation-oauth2-proxy:prlatest + + diff --git a/Makefile b/Makefile index 717e36c0..90b34976 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ GOLANGCILINT ?= golangci-lint BINARY := oauth2-proxy VERSION ?= $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined") # Allow to override image registry. -REGISTRY ?= quay.io/oauth2-proxy +REGISTRY ?= docker.na1.hsdp.io/edi .NOTPARALLEL: GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)