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

feat: Add CD using GitHub Actions #1196

Merged
merged 1 commit into from
Dec 22, 2020
Merged
Changes from all commits
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
45 changes: 45 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
runs-on:
#- self-hosted
- ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14.7
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/kubeflow/tf-operator
- name: setup env
run: |
cd src/github.com/kubeflow/tf-operator
pwd
go env
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: before_install
run: |
# get coveralls.io support
go get github.com/kubeflow/tf-operator
- name: docker-build
run: |
cd src/github.com/kubeflow/tf-operator
docker build -t ghcr.io/kubeflow/tf-operator:$RELEASE_VERSION -f build/images/tf_operator/Dockerfile .
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
- name: docker-push
run: |
docker push ghcr.io/kubeflow/tf-operator:$RELEASE_VERSION -f build/images/tf_operator/Dockerfile .