-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 2.21 KB
/
e.yml
File metadata and controls
71 lines (63 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and deploy container app to Azure Functions - deploydirectory
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🔖 Get release tag name
id: get_release
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
latest: true
doNotFailIfNotFound : true
- name: ♻️ Set correct environment
run: |
TAG=${{ steps.get_release.outputs.tag_name }}
echo "TAG=$TAG" >> "$GITHUB_ENV"
- name: 🐳 Docker metadata
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/leahlandau/try-${{ matrix.directory }}
tags: |
type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{ env.TAG }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.TAG }}
type=semver,pattern={{major}},value=${{ env.TAG }}
- name: 🏗️ Build and 🫸 push image to GitHub Container Registry
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/leahlandau/backup:latest
labels: ${{ steps.docker_meta.outputs.labels }}
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-functions.outputs.functions-url }}
steps:
- name: Deploy to Azure Functions
id: deploy-to-functions
uses: azure/functions-deploy@v2
with:
app-name: 'deploydirectory'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_aff92f69ba354d7a987ee9d85eb459cc }}
images: 'ghcr.io/${{ secrets.AzureAppService_ContainerUsername_e4441d2293124e6a95bc5e64676cff9e }}/python:${{ github.sha }}'