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 3b98c50
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/upgrade-version.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build and Test
name: Upgrade Version and Deploy

on:
release:
types:
- published
push:
branches:
- '*/*'
Expand All @@ -10,22 +13,38 @@ jobs:
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: Docker Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Upgrade server version
run: |
./set-version.sh --pom server/pom.xml
- name: Commit and push
- name: Build Docker image
run: |
docker build -t heavy-mock-http-server:$(./get-next-version.sh) server
- name: Push Docker image
run: |
docker push heavy-mock-http-server:$(./get-next-version.sh)
- name: Commit and push new version
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "⬆️ Upgrade server version"
commit_message: "⬆️ Upgrade server version to $(./get-next-version.sh)"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
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 3b98c50

Please sign in to comment.