👷 Add docker login #6
Workflow file for this run
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
name: Build and Test | |
on: | |
release: | |
types: | |
- published | |
push: | |
branches: | |
- '*/*' | |
jobs: | |
upgrade-version: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: write | |
steps: | |
- 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 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 |