i’ve been stuck for a while now on this issue im having where when i want to deploy my java app to azure it doesnt recognise the artifact that i build in a previous workflow run. these are the build and deploy files:
name: Build JAR app - kobeodbCR-backend
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java version
uses: actions/setup-java@v1
with:
java-version: "17"
- name: Build with Maven
run: mvn clean install
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: java-app
path: "${{ github.workspace }}/target/*.jar"
name: Deploy JAR app to Azure Web App - kobeodbCR-backend
on:
workflow_run:
workflows: ["Build JAR app - kobeodbCR-backend"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: java-app
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: "kobeodbCR-backend"
slot-name: "Production"
package: "*.jar"
publish-profile: ${{ ... }}
and this is the error im getting:
deploy
Unable to download artifact(s): Artifact not found for name: java-app Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact. For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md
does anyone have an idea on why this is happening?
the build workflow completes successfully, and the artifact is created, but the deploy workflow fails after give or take 10 seconds
I’ve tried a few different things, mostly recommendations from chatGPT, but none of them have successfully worked.
Kobe Op de Beeck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.