forked from datastax/cass-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.81 KB
/
operatorPRBuildAndDeploy.yml
File metadata and controls
51 lines (51 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Cass Operator Build & Deploy
on: pull_request
jobs:
build_operator_docker:
name: Build Cass Operator Docker Image
runs-on: ubuntu-latest
env:
GOPATH: /home/runner/go
GOROOT: /usr/local/go1.13
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Install Mage
run: |
cd /tmp
wget https://github.com/magefile/mage/releases/download/v1.9.0/mage_1.9.0_Linux-64bit.tar.gz
tar -xvf mage_1.9.0_Linux-64bit.tar.gz
mkdir -p $GOPATH/bin
mv mage $GOPATH/bin/mage
sudo chmod +x $GOPATH/bin/mage
- name: Build docker
env:
MO_BRANCH: ${{ github.event.pull_request.head.ref }}
run: |
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
mage operator:testAndBuild
- name: Deploy to ECR
if: github.event.pull_request.head.repo.full_name == 'datastax/cass-operator'
env:
MO_ECR_ID: ${{ secrets.ECR_ID }}
MO_ECR_SECRET: ${{ secrets.ECR_SECRET }}
MO_ECR_REPO: ${{ secrets.ECR_REPO }}
run: |
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
export MO_TAGS=$(cat ./build/tagsToPush.txt)
mage operator:deployToECR
- name: Deploy to GH Packages
if: github.event.pull_request.head.repo.full_name == 'datastax/cass-operator'
env:
MO_GH_USR: 'datastax/cass-operator'
MO_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MO_GH_PKG_REPO: 'datastax/cass-operator/operator'
run: |
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
export MO_TAGS=$(cat ./build/tagsToPush.txt)
mage operator:deployToGHPackages