Skip to content
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

feat: migrate from Azure Static Web Apps to Azure Container Apps #16

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

glaucia86
Copy link
Contributor

Purpose

This pull request introduces several significant changes to the project infrastructure, including Docker configuration, GitHub Actions workflow for deployment, and updates to package scripts. The most important changes are listed below:

Docker Configuration:

  • Added a Dockerfile to define the build and production stages for the application, including setting environment variables, copying source code, installing dependencies, and setting up a non-root user for security.
  • Updated the .dockerignore file to exclude unnecessary files and directories from the Docker build context, such as node_modules, .git, and README.md.

GitHub Actions Workflow:

  • Added a new GitHub Actions workflow file .github/workflows/azure-container-apps.yml to automate the build and deployment process to Azure Container Apps. This includes steps for Azure login, Docker image build and push, and deployment to Azure Container Apps.

Package Scripts:

  • Updated package.json to include new scripts for Docker operations (docker:build, docker:run, docker:test) and modified the start script to use node with the --expose-gc flag. Also added a start:dev script for development purposes. (package.jsonL15-R19R12)

Does this introduce a breaking change?

[x] Yes
[ ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@glaucia86 glaucia86 added the enhancement New feature or request label Feb 12, 2025
@glaucia86 glaucia86 self-assigned this Feb 12, 2025
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
runs-on: ubuntu-latest
steps:
- name: Azure Login
uses: azure/login@v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Azure Container Apps CD' step
Uses Step
uses 'azure/login' with ref 'v1', not a pinned commit hash
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Deploy to Azure Container Apps
uses: azure/container-apps-deploy-action@v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Azure Container Apps CD' step
Uses Step
uses 'azure/container-apps-deploy-action' with ref 'v1', not a pinned commit hash
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Login to Azure Container Registry
uses: docker/login-action@v3

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Azure Container Apps CD' step
Uses Step
uses 'docker/login-action' with ref 'v3', not a pinned commit hash
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
.github/workflows/azure-container-apps.yml Fixed Show fixed Hide fixed
cache: 'npm'

- name: Azure Login
uses: azure/login@v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Azure Container Apps CD' step
Uses Step
uses 'azure/login' with ref 'v1', not a pinned commit hash
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Azure Container Apps CD' step
Uses Step
uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v5

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Azure Container Apps CD' step
Uses Step
uses 'docker/build-push-action' with ref 'v5', not a pinned commit hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant