-
Notifications
You must be signed in to change notification settings - Fork 20
65 lines (65 loc) · 1.98 KB
/
catalog-api.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: catalog-api
on:
push:
paths:
- 'catalog-api/**'
- '.github/workflows/catalog-api.yml'
branches:
- master
pull_request:
paths:
- 'catalog-api/**'
- '.github/workflows/catalog-api.yml'
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '15.x'
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: mvn package
env:
_JAVA_OPTIONS: -Duser.timezone=Asia/Tokyo
run: |
set -ex
./mvnw -V package -f catalog-api/pom.xml -U
- name: mvn spring-boot:build-image
if: github.ref == 'refs/heads/master'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
IMAGE_NAME: ghcr.io/making/spring-socks-catalog
run: |
set -e
docker login ${DOCKER_REGISTRY} -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
set +e
docker pull ${IMAGE_NAME}
set -e
./mvnw -V spring-boot:build-image -f catalog-api/pom.xml -Dspring-boot.build-image.imageName=${IMAGE_NAME} -Dmaven.test.skip=true
docker push ${IMAGE_NAME}
- uses: jvalkeal/setup-cf-cli@v0
if: github.ref == 'refs/heads/master'
with:
version: 7.1.0
- name: cf push
if: github.ref == 'refs/heads/master'
env:
CF_API: ${{ secrets.CF_API }}
CF_USERNAME: ${{ secrets.CF_USERNAME }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
CF_ORG: ${{ secrets.CF_ORG }}
CF_SPACE: ${{ secrets.CF_SPACE }}
run: |
set -e
cf login -a ${CF_API} -u ${CF_USERNAME} -p ${CF_PASSWORD} -o ${CF_ORG} -s ${CF_SPACE}
cf push -f catalog-api/manifest.yml --strategy rolling