Merge pull request #199 from chjcode/fix/conflict #40
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 Deploy to Docker Hub | |
on: | |
push: | |
branches: [ "release", "dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Build with Gradle | |
run: ./gradlew build --daemon --parallel | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Set Docker repository | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/release" ]]; then | |
echo "DOCKER_REPO=yeseulhong/grass-diary-release" >> $GITHUB_ENV | |
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then | |
echo "DOCKER_REPO=yeseulhong/grass-diary-dev" >> $GITHUB_ENV | |
fi | |
- name: Build and Push Docker Image | |
run: | | |
docker buildx create --use | |
docker buildx build --platform linux/arm64,linux/amd64 -t ${{ env.DOCKER_REPO }}:latest --push . |