This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github actions for publish docker images
- Loading branch information
1 parent
38afc9e
commit a29d6b8
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: 'Publish Sale Dock Images' | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Release Sale Dock] | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish: | ||
name: 'Publish Sale Dock 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 17' | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
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 Sale Dock Database' | ||
working-directory: ${{ github.workspace }}/database | ||
run: | | ||
docker build . -t ghcr.io/hardingadonis/saledock-database:${{ steps.get_version.outputs.version }} -t ghcr.io/hardingadonis/saledock-database:latest | ||
docker push ghcr.io/hardingadonis/saledock-database:${{ steps.get_version.outputs.version }} | ||
docker push ghcr.io/hardingadonis/saledock-database:latest | ||
- name: 'Publish Sale Dock Server' | ||
working-directory: ${{ github.workspace }}/server | ||
run: | | ||
docker build . -t ghcr.io/hardingadonis/saledock-server:${{ steps.get_version.outputs.version }} -t ghcr.io/hardingadonis/saledock-server:latest | ||
docker push ghcr.io/hardingadonis/saledock-server:${{ steps.get_version.outputs.version }} | ||
docker push ghcr.io/hardingadonis/saledock-server:latest |