diff --git a/.github/workflows/production-backend.yml b/.github/workflows/production-backend.yml index 01f0f25..c48d4f7 100644 --- a/.github/workflows/production-backend.yml +++ b/.github/workflows/production-backend.yml @@ -10,9 +10,9 @@ defaults: working-directory: ./backend jobs: - build: + build_and_deploy_job: runs-on: ubuntu-latest - + name: Build & Deploy Job steps: - uses: actions/checkout@v4 - uses: azure/docker-login@v1 @@ -20,11 +20,13 @@ jobs: login-server: francispion.azurecr.io username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - - run: | + - name: Build & Push Docker image + run: | docker build . -t francispion.azurecr.io/wishes-api:${{ github.sha }} -f src/Logitar.Wishes/Dockerfile docker push francispion.azurecr.io/wishes-api:${{ github.sha }} - - uses: azure/webapps-deploy@v3 + - name: Deploy Docker image + uses: azure/webapps-deploy@v3 with: - app-name: 'api-wishes' + app-name: "api-wishes" publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PRODUCTION }} - images: 'francispion.azurecr.io/wishes-api:${{ github.sha }}' + images: "francispion.azurecr.io/wishes-api:${{ github.sha }}" diff --git a/.github/workflows/production-frontend.yml b/.github/workflows/production-frontend.yml new file mode 100644 index 0000000..5196d92 --- /dev/null +++ b/.github/workflows/production-frontend.yml @@ -0,0 +1,29 @@ +name: Deploy Production Frontend + +on: + release: + types: [published] + workflow_dispatch: + +defaults: + run: + working-directory: ./frontend + +jobs: + build_and_deploy_job: + runs-on: ubuntu-latest + name: Build & Deploy Job + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Build & Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_WEBAPP_DEPLOYMENT_TOKEN_PRODUCTION }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + action: "upload" + app_location: "/" + app_build_command: "npm run build" + output_location: "dist"