Skip to content

Commit

Permalink
👷 Add docker login
Browse files Browse the repository at this point in the history
  • Loading branch information
heavynimbus committed May 31, 2024
1 parent 7410c47 commit 626c287
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/upgrade-version.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
name: Build and Test

on:
release:
types:
- published
push:
branches:
- '*/*'

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}

jobs:
upgrade-version:
runs-on: ubuntu-latest

permissions:
packages: write
contents: write

steps:
- name: Checkout
- name: Check out the repo
uses: actions/checkout@v4

- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21.0.3'
cache: 'maven'
cache-dependency-path: 'server/pom.xml'
- name: Upgrade server version
run: |
./set-version.sh --pom server/pom.xml
- name: Commit and push
uses: stefanzweifel/git-auto-commit-action@v5
- name: echo dockerhub username
run: echo ${{ env.DOCKERHUB_USERNAME }}

- name: Docker Login
uses: docker/login-action@v3
with:
commit_message: "⬆️ Upgrade server version"
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_PASSWORD }}

# - name: Upgrade server version
# run: |
# ./set-version.sh --pom server/pom.xml
#
# - name: Commit and push new version
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: "⬆️ Upgrade server version to $(./get-next-version.sh)"
#
# - name: Build docker image
# run: |
# docker build -t heavy-mock-http-server:$(./get-next-version.sh) server
3 changes: 3 additions & 0 deletions get-next-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

grep -rE 'version.next=[0-9]+\.[0-9]+\.[0-9]+' version.properties | cut -d '=' -f2
File renamed without changes.

0 comments on commit 626c287

Please sign in to comment.