This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.93 KB
/
publish.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
56
57
58
59
60
61
62
name: 'Publish Miu Shop Images'
on:
workflow_run:
workflows: [Release Miu Shop]
types:
- completed
branches:
- main
jobs:
publish:
name: 'Publish Miu Shop Images'
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: read
packages: write
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Set up JDK 8'
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
architecture: 'x64'
- name: 'Build project with Maven'
run: |
mvn verify
- name: 'Get version'
id: get_version
run: |
chmod +x get_version.sh
echo "version=$(./get_version.sh)" >> $GITHUB_OUTPUT
- name: 'Login ghcr.io'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish Miu Shop Database'
working-directory: ${{ github.workspace }}/database
run: |
docker build . -t ghcr.io/hardingadonis/miu-shop-database:${{ steps.get_version.outputs.version }} -t ghcr.io/hardingadonis/miu-shop-database:latest
docker push ghcr.io/hardingadonis/miu-shop-database:${{ steps.get_version.outputs.version }}
docker push ghcr.io/hardingadonis/miu-shop-database:latest
- name: 'Publish Miu Shop Server'
working-directory: ${{ github.workspace }}/server
run: |
docker build . -t ghcr.io/hardingadonis/miu-shop-server:${{ steps.get_version.outputs.version }} -t ghcr.io/hardingadonis/miu-shop-server:latest
docker push ghcr.io/hardingadonis/miu-shop-server:${{ steps.get_version.outputs.version }}
docker push ghcr.io/hardingadonis/miu-shop-server:latest