-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.67 KB
/
maven.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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: spotify-youtube-sync ci/cd
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn clean install
env:
POSTGRES_HOST: ${{ vars.POSTGRES_HOST }}
POSTGRES_NAME: ${{ vars.POSTGRES_NAME }}
POSTGRES_PASS: ${{ vars.POSTGRES_PASS }}
POSTGRES_PORT: ${{ vars.POSTGRES_PORT }}
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
REDIS_HOST: ${{ vars.REDIS_HOST }}
REDIS_USER: ${{ vars.REDIS_USER }}
REDIS_PASS: ${{ vars.REDIS_PASS }}
REDIS_PORT: ${{ vars.REDIS_PORT }}
- name: login to docker registry
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: build and push docker image to registry
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: kushparsaniya/spotify-youtube-sync-github-action:latest