forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (52 loc) · 2.03 KB
/
samples.07.a.upload-to-azure-storage.yaml
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
name: samples/07.a.upload-to-azure-storage
on:
workflow_dispatch: {} # Pipeline is disabled
# on:
# push:
# branches:
# - main
# paths:
# - .github/workflows/samples.07.a.upload-to-azure-storage.yaml
# - samples/07.advanced-web-chat-apps/a.upload-to-azure-storage/**
env:
APP_NAME: webchat-samples-uploadazurestorage
# DOCKER_IMAGE: your-own-registry.azurecr.io/webchat-samples-uploadazurestorage
# DOCKER_REGISTRY: your-own-registry.azurecr.io
DOCKER_TAG: sha-${{ github.sha }}
DOCKERFILE_PATH: samples/07.advanced-web-chat-apps/a.upload-to-azure-storage
PUBLISH_PROFILE: ${{ secrets.SAMPLES_UPLOADAZURESTORAGE_PUBLISH_PROFILE }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checking out for ${{ github.ref }}
uses: actions/checkout@v2
- name: Read variables
id: variables
run: |
echo "::set-output name=short_sha::${GITHUB_SHA:0:7}"
- uses: azure/docker-login@v1
with:
login-server: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.SAMPLES_DOCKER_USERNAME }}
password: ${{ secrets.SAMPLES_DOCKER_PASSWORD }}
- name: Build and publish the image
run: |
cd ${{ env.DOCKERFILE_PATH }}
docker build . -t builder
docker create --name builder-image builder
docker cp builder-image:/var/build/build.tgz .
docker rm builder-image
docker build . -f Dockerfile-run -t ${{ env.DOCKER_IMAGE }}:latest -t ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}
docker push ${{ env.DOCKER_IMAGE }}:latest
docker push ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}
- uses: actions/upload-artifact@v2
with:
name: build
path: ${{ env.DOCKERFILE_PATH }}/build.tgz
- name: Publish to ${{ env.APP_NAME }}
uses: azure/[email protected]
with:
app-name: ${{ env.APP_NAME }}
images: ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}
publish-profile: ${{ env.PUBLISH_PROFILE }}