Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveScott99 committed Feb 11, 2024
2 parents 02dd660 + ef9bef8 commit 03e7d3e
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.1
- name: Chechout code
uses: actions/checkout@v4.1.1

- name: Setup Java
uses: actions/setup-java@v4.0.0
with:
distribution: 'temurin'
java-version: '17'

- name: Get short commit hash
id: commit_hash
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"

- name: Build project
run: mvn clean install -DskipTests

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PWD}}
- name: BUILD AND PUSH
uses: docker/build-push-action@v5.1.0
with:
context: ./
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_USER }}/astfx-discserv:${{ github.run_number }}
${{ secrets.DOCKER_USER }}/astfx-discserv:latest

- name: Build Docker image version tag
run: docker build -t ${{ secrets.DOCKER_USER }}/astfx-discserv:v1.${{ github.run_number }}.${{ steps.commit_hash.outputs.hash }} .

- name: Build Docker image latest tag
run: docker build -t ${{ secrets.DOCKER_USER }}/astfx-discserv:latest .

- name: Push image Docker with version tag
run: docker push ${{ secrets.DOCKER_USER }}/astfx-discserv:v1.${{ github.run_number }}.${{ steps.commit_hash.outputs.hash }}

- name: Push image Docker with latest tag
run: docker push ${{ secrets.DOCKER_USER }}/astfx-discserv:latest

0 comments on commit 03e7d3e

Please sign in to comment.