Skip to content

Commit

Permalink
feat: Add CD using GitHub Actions (#1196)
Browse files Browse the repository at this point in the history
Signed-off-by: cegao <cegao@tencent.com>
  • Loading branch information
gaocegege committed Dec 22, 2020
1 parent 159b1f8 commit a0b309e
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish.yaml
@@ -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 .

0 comments on commit a0b309e

Please sign in to comment.