-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ER 782 Create app service to host web application dev subscription #653
Merged
ebrett
merged 2 commits into
main
from
ER-782-create-app-service-to-host-web-application-dev-subscription
Oct 4, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: 'HfEYP App Deploy [Azure - DEV]' | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**/*.md' | ||
- .docker* | ||
- .env.example | ||
- .gitignore | ||
- .tool-versions | ||
- .yardopts | ||
- bin/* | ||
- docker-compose.* | ||
- terraform/** | ||
- terraform-azure/** | ||
|
||
# Permissions for OIDC authentication | ||
permissions: | ||
id-token: write | ||
contents: write | ||
packages: write | ||
|
||
env: | ||
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
DOCKER_IMAGE: ghcr.io/dfe-digital/help-for-early-years-providers | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
environment: development | ||
|
||
steps: | ||
- name: Check workflow concurrency | ||
uses: softprops/turnstyle@v1 | ||
with: | ||
poll-interval-seconds: 20 | ||
same-branch-only: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Checkout the repository to the GitHub Actions runner | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
# Create and boot Docker image builder | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: v0.9.1 | ||
|
||
# Login to the container registry | ||
- name: Login to Github Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push docker image from builder target | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
build-args: BUILDKIT_INLINE_CACHE=1 | ||
cache-from: | | ||
${{ env.DOCKER_IMAGE }}-dev:builder | ||
push: true | ||
tags: ${{ env.DOCKER_IMAGE }}-dev:builder | ||
target: builder | ||
|
||
- name: Build and push docker image from help-for-early-years-providers-gems-node-modules target | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
build-args: BUILDKIT_INLINE_CACHE=1 | ||
cache-from: | | ||
${{ env.DOCKER_IMAGE }}-dev:gems-node-modules | ||
push: true | ||
tags: ${{ env.DOCKER_IMAGE }}-dev:gems-node-modules | ||
target: help-for-early-years-providers-gems-node-modules | ||
|
||
- name: Build and push docker image from assets-precompile target | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
build-args: BUILDKIT_INLINE_CACHE=1 | ||
cache-from: | | ||
${{ env.DOCKER_IMAGE }}-dev:assets-precompile | ||
push: true | ||
tags: ${{ env.DOCKER_IMAGE }}-dev:assets-precompile | ||
target: assets-precompile | ||
|
||
- name: Build and push docker image from production target | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
build-args: | | ||
BUILDKIT_INLINE_CACHE=1 | ||
SHA=${{ github.sha }} | ||
cache-from: | | ||
type=registry,ref=${{ env.DOCKER_IMAGE }}-prod:latest | ||
push: true | ||
tags: | | ||
${{ env.DOCKER_IMAGE }}-prod:latest | ||
${{ env.DOCKER_IMAGE }}-prod:${{ github.sha }} | ||
target: production | ||
|
||
# Login to Azure using OIDC | ||
- name: Login to Azure CLI | ||
uses: azure/login@v1 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
# Deploy Web Application | ||
- name: Deploy to Azure App Services | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: ${{ vars.WEBAPP_NAME }} | ||
images: ${{ env.DOCKER_IMAGE }}:${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array of files to ignore might want looking at. Some of these files don't exist in this project and should be removed but others might also need to be added in their place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Agree on this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did look at them and removed the ones below - the ones I kept were either there or could be added but should probably still be ignored.