-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (42 loc) · 1.29 KB
/
ci-cd.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
name: CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Java 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Build with Maven
run: mvn -B package --file pom.xml
env:
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
CUCUMBER_PUBLISH_ENABLED: true
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to fly.io
if: success() && github.ref == 'refs/heads/main'
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Login to DockerHub
if: success() && github.ref == 'refs/heads/main'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
if: success() && github.ref == 'refs/heads/main'
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
udlepssoftarch/spring-template:${{ github.sha }}
udlepssoftarch/spring-template:latest