-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 965 Bytes
/
build.yaml
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
name: Build and Push Docker Image
permissions:
contents: write
packages: write
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
env:
IMAGE_NAME: distributed-node
IMAGE_TAG: latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Build Docker image and push to GitHub Container Registry
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
./mvnw clean compile jib:dockerBuild
docker tag $IMAGE_NAME:0.0.1-SNAPSHOT ghcr.io/scatterrr-cse19/$IMAGE_NAME:$IMAGE_TAG
docker push ghcr.io/scatterrr-cse19/$IMAGE_NAME:$IMAGE_TAG