-
Notifications
You must be signed in to change notification settings - Fork 17
50 lines (50 loc) · 1.8 KB
/
buildAndDeploy.yml
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
name: Cass Config Builder Build & Deploy
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_operator_docker:
name: Build Cass Config Builder Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
with:
submodules: true
- name: Login to GitHub Package Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u "${{ github.actor }}" --password-stdin
- name: Setup Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v3
- name: Cache Docker layers
uses: actions/cache@v3
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
java-version: 1.8
- name: Run tests
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'datastax/cass-config-builder'
env:
ORG_GRADLE_PROJECT_dockerRegistry: docker.pkg.github.com
ORG_GRADLE_PROJECT_dockerRegistryUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_dockerRegistryPassword: ${{ secrets.GITHUB_TOKEN }}
uses: eskatos/gradle-command-action@v1
with:
gradle-version: 6.0.1
arguments: test
- name: Build docker image
env:
GITHUB_REPO_OWNER: ${{ github.repository_owner }}
run: |
export GITHUB_REPO_URL="https://github.com/${{ github.repository }}"
./scripts/build-push-images.sh