Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
cliedl committed Feb 5, 2025
1 parent e0c4ddb commit 5358d3e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
50 changes: 35 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: 3. Deploy to Azure

on:
push:
branches:
- github-actions-test
release:
types: [published]

# enables manual triggers
workflow_dispatch:
Expand All @@ -19,17 +18,38 @@ jobs:
runs-on: ubuntu-latest
needs: []
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Get release version
id: get_version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "version=${{ inputs.release_id }}" >> $GITHUB_OUTPUT
fi
- name: Deploy to Azure Container Apps
run: |
az containerapp update \
--name electify \
--resource-group electify-app \
--image cliedl/electify:1.0.1
- name: Build Docker Image
run: |
docker build --platform linux/amd64 -t cliedl/electify:${{ steps.get_version.outputs.version }} .
- name: Push Docker Image
run: |
docker push cliedl/electify:${{ steps.get_version.outputs.version }}
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Build and deploy Container App
uses: azure/container-apps-deploy-action@v1
with:
acrName: myregistry
containerAppName: my-container-app
resourceGroup: my-rg
imageToDeploy: cliedl/electify:${{ steps.get_version.outputs.version }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: 2. Draft Release
on:
push:
branches:
- github-actions-test
- main
- github-actions-test
pull_request:
types:
- closed
Expand Down

0 comments on commit 5358d3e

Please sign in to comment.