chore(deps): bump docker/setup-buildx-action from 1 to 3 #1033
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 oauth2-dev-server | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-oauth2-dev-server: | |
runs-on: ubuntu-latest | |
steps: | |
- id: skip_check | |
uses: fkirc/[email protected] | |
with: | |
paths: '["code/oauth2-dev-server/**", ".github/workflows/build-oauth2-dev-server.yaml"]' | |
cancel_others: 'true' | |
skip_after_successful_duplicate: 'false' | |
do_not_skip: '["workflow_dispatch"]' | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Checkout | |
uses: actions/checkout@v2 | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Install xmllint | |
run: sudo apt-get update && sudo apt-get install libxml2-utils | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Set up JDK | |
uses: actions/[email protected] | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
cache: 'maven' | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Build | |
run: mvn -f code/oauth2-dev-server -B clean install | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Prepare | |
id: prep | |
run: | | |
PUSH=FALSE | |
pushd code | |
APP_EXISTS=$(make -s check-oads-image) | |
popd | |
if [[ $GITHUB_REF == refs/heads/* ]]; then | |
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') | |
if [ "${{ github.event.repository.default_branch }}" = "$BRANCH_NAME" ] && [ "$APP_EXISTS" != 'true' ]; then | |
PUSH=TRUE | |
fi | |
elif [[ $GITHUB_REF == refs/pull/* ]]; then | |
BRANCH_NAME=$(echo ${{ github.event.pull_request.head.ref }} | sed -r 's#/+#-#g') | |
if [[ $BRANCH_NAME == release-* ]]; then | |
PUSH=TRUE | |
SUFFIX=rc | |
else | |
SUFFIX=pr-${{ github.event.number }} | |
fi | |
fi | |
echo ::set-output name=push::${PUSH} | |
echo ::set-output name=suffix::${SUFFIX} | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' && steps.prep.outputs.push == 'true'}} | |
name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
name: Build and push | |
run: | | |
cd code | |
make build-oads SUFFIX=${{ steps.prep.outputs.suffix }} PUBLISH=${{ steps.prep.outputs.push }} |