Skip to content

Merge pull request #220 from CHZZK-Study/dev #63

Merge pull request #220 from CHZZK-Study/dev

Merge pull request #220 from CHZZK-Study/dev #63

Workflow file for this run

name: Build and Deploy to Docker Hub
on:
push:
branches: [ "release", "dev" ]
paths-ignore:
- 'docs/**'
- 'readme.md'
- 'k8s/**'
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 .