diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..53f5afd --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,43 @@ +name: Build and deploy +on: + push: + branches: + - main +jobs: + build: + name: Build and deploy + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'liberica' + + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + + - name: Build + run: ./gradlew build + + - name: Set up Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Set up Azure Spring Extension + run: az extension add --name spring + + - name: Deploy + run: | + az spring app deploy \ + --name calendar \ + --service spring-team \ + --resource-group spring-team \ + --artifact-path build/libs/spring-calendar.jar \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 7b687ca..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Deploy - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'liberica' - - name: Set up Gradle - uses: gradle/gradle-build-action@v2 - - name: Build - run: ./gradlew build