From aa2fec581cc5c60f7a81a3e5dddf50a112cdddc8 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 16 Nov 2023 13:08:29 +0000 Subject: [PATCH] Deploy from CI --- .github/workflows/build-and-deploy.yml | 43 ++++++++++++++++++++++++++ .github/workflows/deploy.yml | 21 ------------- 2 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/build-and-deploy.yml delete mode 100644 .github/workflows/deploy.yml 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