Add excludes support #41
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: CI | |
on: | |
push: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Evaluate app version | |
run: | | |
echo "APP_VERSION=$(date '+%Y-%m-%d')-$(git rev-parse HEAD | cut -c -6)" >> "$GITHUB_ENV" | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Build plugin | |
run: ./gradlew buildPlugin | |
- name: Unzip plugin distribution | |
run: unzip -o build/distributions/formatter-plugin-*.zip -d build/distributions | |
- name: Pull existing image for layer cache | |
run: docker pull funbiscuit/idea-formatter:latest | |
- name: Build docker image | |
run: docker build . -t "funbiscuit/idea-formatter:$APP_VERSION" --cache-from funbiscuit/idea-formatter:latest | |
- name: Add latest tag | |
run: docker tag "funbiscuit/idea-formatter:$APP_VERSION" funbiscuit/idea-formatter:latest | |
- name: Test image | |
run: docker run --rm -v ${{ github.workspace }}:/data funbiscuit/idea-formatter --style CodeStyle.xml --dry --recursive src | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: funbiscuit | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push docker image | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
run: docker push "funbiscuit/idea-formatter:$APP_VERSION" && docker push funbiscuit/idea-formatter:latest |