Skip to content

RO-1091: Vis oppdatert- og registrert-tidspunkt i observasjonskort på web #2741

RO-1091: Vis oppdatert- og registrert-tidspunkt i observasjonskort på web

RO-1091: Vis oppdatert- og registrert-tidspunkt i observasjonskort på web #2741

# Github actions triggered by happenings on develop branch. Used to build and deploy PR test-apps and beta.regobs.no
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- develop
jobs:
# Run when a pull request is created or updated
build_and_deploy_pull_request:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
runs-on: ubuntu-latest
name: Build and Deploy Pull Request
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Create apiKey.json file
env:
REGOBS_API_KEY: ${{secrets.REGOBS_APPTOKEN}}
shell: bash
run: |
echo "{\"apiKey\":\"$REGOBS_API_KEY\"}" > ./src/assets/apikey.json
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_WATER_056410803 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: 'upload'
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: '/' # App source code path
# api_location: "api" # Api source code path - optional
output_location: 'www' # Built app content directory - optional
app_build_command: 'npm run create-version-file && npm run build'
###### End of Repository/Build Configurations ######
# Run when we push to develop
build_and_deploy_develop:
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
name: Build and Deploy develop-branch (beta.regobs.no)
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Create apiKey.json file
env:
REGOBS_API_KEY: ${{secrets.REGOBS_APPTOKEN}}
shell: bash
run: |
echo "{\"apiKey\":\"$REGOBS_API_KEY\"}" > ./src/assets/apikey.json
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_WATER_056410803 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: 'upload'
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: '/' # App source code path
# api_location: "api" # Api source code path - optional
output_location: 'www' # Built app content directory - optional
# app_build_command: For Node.js applications, you can define a custom command to build the static content application.
app_build_command: 'npm run translations:add-nn-app-fallback && npm run create-version-file && npm run build:prod'
###### End of Repository/Build Configurations ######
- id: set_version
run: |
content=`cat ./src/environments/version.json`
echo "::set-output name=packageJson::$content"
- run: |
echo '${{fromJson(steps.set_version.outputs.packageJson).version}}'
###### Install Sentry CLI & Create new Sentry releas ######
- run: |
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli releases new ${{fromJson(steps.set_version.outputs.packageJson).version}}
sentry-cli releases files ${{fromJson(steps.set_version.outputs.packageJson).version}} upload-sourcemaps www -x .js -x .map --dist ${{fromJson(steps.set_version.outputs.packageJson).revision}} --log-level=debug --validate --verbose --rewrite --strip-common-prefix --url-prefix=~
sentry-cli releases finalize ${{fromJson(steps.set_version.outputs.packageJson).version}}
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_WATER_056410803 }}
action: 'close'