Skip to content

Commit 25228e4

Browse files
committed
Add Github Action and remove Travis
1 parent 7d6152a commit 25228e4

3 files changed

Lines changed: 55 additions & 57 deletions

File tree

.github/workflows/build.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build
2+
on: [push]
3+
env:
4+
FAF_DB_VERSION: v100
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
container: adoptopenjdk:11-jdk-hotspot-bionic
9+
services:
10+
faf-db:
11+
image: mysql:5.7
12+
ports:
13+
- 3306:3306
14+
options: >-
15+
--health-cmd "mysqladmin ping --silent"
16+
--health-interval 10s
17+
--health-timeout 5s
18+
--health-retries 5
19+
env:
20+
MYSQL_ROOT_PASSWORD: banana
21+
MYSQL_DATABASE: faf
22+
MYSQL_USER: faf-java-api
23+
MYSQL_PASSWORD: banana
24+
steps:
25+
- name: Install tools
26+
run: apt update && apt install -y git wget
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
- name: Run flyway db migrations
30+
env:
31+
FLYWAY_URL: jdbc:mysql://faf-db/faf?useSSL=false
32+
FLYWAY_USER: root
33+
FLYWAY_PASSWORD: banana
34+
FLYWAY_LOCATIONS: filesystem:db/migrations
35+
run: |-
36+
git clone --depth 1 --branch $FAF_DB_VERSION https://github.com/FAForever/db
37+
wget -qO- https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/6.5.3/flyway-commandline-6.5.3-linux-x64.tar.gz | tar xvz && ln -s `pwd`/flyway-6.5.3/flyway /usr/local/bin
38+
flyway migrate
39+
- name: Gradle build
40+
env:
41+
GRADLE_CLI_OPTS: "--console=plain --stacktrace --quiet"
42+
DATABASE_ADDRESS: faf-db
43+
run: "chmod +x ./gradlew && ./gradlew ${GRADLE_CLI_OPTS} build"
44+
- name: Build and push Docker images
45+
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags')
46+
uses: docker/build-push-action@master
47+
with:
48+
username: ${{ secrets.DOCKER_USERNAME }}
49+
password: ${{ secrets.DOCKER_PASSWORD }}
50+
repository: faforever/faf-java-api
51+
tag_with_ref: true

.travis.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ FROM adoptopenjdk/openjdk11:alpine-jre
88
VOLUME /tmp
99
WORKDIR /application
1010
COPY --from=builder /application/dependencies/ ./
11+
RUN true
1112
COPY --from=builder /application/spring-boot-loader/ ./
13+
RUN true
1214
COPY --from=builder /application/snapshot-dependencies/ ./
15+
RUN true
1316
COPY --from=builder /application/application/ ./
17+
RUN true
1418
ENTRYPOINT ["java", "-server", "-Djava.security.egd=file:/dev/./urandom", "org.springframework.boot.loader.JarLauncher"]

0 commit comments

Comments
 (0)