-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.52 KB
/
build.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
name: Build and Publish
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn clean install
- name: Build Docker image
run: docker build -t my-storage-image .
- name: Log into GitHub Packages
run: echo "${{ secrets.PERSONAL_TOKEN }}" | docker login docker.pkg.github.com -u "${{ github.actor }}" --password-stdin
- name: Tag Docker image
run: docker tag my-storage-image docker.pkg.github.com/narvane/my-storage/my-storage-image:${{ github.event.release.tag_name }}
- name: Push Docker image to GitHub Packages
run: docker push docker.pkg.github.com/narvane/my-storage/my-storage-image:${{ github.event.release.tag_name }}
# publish:
# runs-on: ubuntu-latest
#
# steps:
# - name: Log into GitHub Packages
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u "${{ github.actor }}" --password-stdin
#
# - name: Tag Docker image
# run: docker tag my-storage-image:latest docker.pkg.github.com/narvane/my-storage/my-storage-image:${{ github.event.release.tag_name }}
#
# - name: Push Docker image to GitHub Packages
# run: docker push docker.pkg.github.com/narvane/my-storage/my-storage-image:${{ github.event.release.tag_name }}