Skip to content

Commit

Permalink
Merge pull request #5 from Altinn/#722_Update_github_actions
Browse files Browse the repository at this point in the history
#722: Rewrite of action + prod action
  • Loading branch information
kurt70 authored Nov 7, 2024
2 parents 694aaa4 + 010de2a commit d702c78
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 42 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/main_oed-test-feedpoller-func.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/prod-build_n_deploy-feedpoller-func.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy feedpoller-func to production

on:
push:
branches:
- main
workflow_dispatch:

env:
DOTNET_VERSION: '6.0.x' # set this to the dotnet version to use

jobs:
build-and-deploy:
runs-on: windows-latest
environment: Production
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: Skriv ut GitHub metadata
run: |
echo "Repo: $GITHUB_REPOSITORY"
echo "Branch: $GITHUB_REF_NAME"
echo "Commit SHA: $GITHUB_SHA"
echo "Actor: $GITHUB_ACTOR"
echo "Run #: $GITHUB_RUN_NUMBER"
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
include-prerelease: true

- name: dotnet publish
run: dotnet publish -c Release -o "${{env.GITHUB_WORKSPACE}}\myapp"

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: deploy-to-function
with:
app-name: 'oed-test-feedpoller-func'
slot-name: 'Production'
package: "${{env.GITHUB_WORKSPACE}}\\myapp"
publish-profile: ${{ secrets.PUBLISH_PROFILE }}
47 changes: 47 additions & 0 deletions .github/workflows/test-build_n_deploy-feedpoller-func.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy feedpoller-func to test

on:
push:
branches:
- main
workflow_dispatch:

env:
DOTNET_VERSION: '6.0.x' # set this to the dotnet version to use

jobs:
build-and-deploy:
runs-on: windows-latest
environment: Test
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: Skriv ut GitHub metadata
run: |
echo "Repo: $GITHUB_REPOSITORY"
echo "Branch: $GITHUB_REF_NAME"
echo "Commit SHA: $GITHUB_SHA"
echo "Actor: $GITHUB_ACTOR"
echo "Run #: $GITHUB_RUN_NUMBER"
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
include-prerelease: true

- name: dotnet publish
run: dotnet publish -c Release -o "${{env.GITHUB_WORKSPACE}}\myapp"

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: deploy-to-function
with:
app-name: 'oed-test-feedpoller-func'
slot-name: 'Production'
package: "${{env.GITHUB_WORKSPACE}}\\myapp"
publish-profile: ${{ secrets.PUBLISH_PROFILE }}

0 comments on commit d702c78

Please sign in to comment.