Merge pull request #106 from UdL-EPS-SoftArch/Issue-volunteer-can-kic… #222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/mypets-gei-api:${{ github.sha }} | |
udlepssoftarch/mypets-gei-api:latest |