Added Continuous Delivery #1
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: Delivery to Docker Hub | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
# push: | ||
# branches: [ main ] | ||
jobs: | ||
delivery: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository to the runner | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Get Spring project version | ||
shell: bash -l {0} | ||
run: echo project_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $APP_VERSION | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
target: final | ||
tags: saneci/book-library:${{APP_VERSION}} | ||
Check failure on line 37 in .github/workflows/docker-cd.yml GitHub Actions / Delivery to Docker HubInvalid workflow file
|