-
Notifications
You must be signed in to change notification settings - Fork 627
/
go-webapp-on-azure.yml
43 lines (42 loc) · 1.28 KB
/
go-webapp-on-azure.yml
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
# Go on Linux Web App
# Build a Go project and deploy it to Azure as a Linux web app.
name: Deploy Go package to Azure Web App as a Linux web app.
on:
[push]
# CONFIGURATION
# For help, go to https://github.com/Azure/Actions
#
# 1. Set up the following secrets in your repository:
# AZURE_PUBLISH_PROFILE
#
# 2. Change these variables for your configuration:
env:
AZURE_WEBAPP_NAME: <APP_NAME> # set this to your application's name
WORKING_DIRECTORY: '.' # set this to the path to your path of working directory inside github repository, defaults to the repository root
GO_VERSION: '1.18' # set this to your application's go version
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production
steps:
# checkout the repo
- uses: actions/checkout@v3
# setup Go
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- run: go version
# install dependencies
- name: go build
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
go build
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
slot-name: 'Production'
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE}}
package: .