Update pages.yml
This commit is contained in:
parent
a96a83a4bf
commit
a0014315c0
1 changed files with 41 additions and 10 deletions
51
.github/workflows/pages.yml
vendored
51
.github/workflows/pages.yml
vendored
|
@ -1,17 +1,48 @@
|
|||
name: Go on Pages
|
||||
on: [push]
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
# Change your go version as needed
|
||||
go-version: 1.17
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
- name: Upload artifact for deployment jobs
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: go-app
|
||||
path: |
|
||||
.
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
environment:
|
||||
name: 'Production'
|
||||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
go-version: '1.21.x'
|
||||
- name: Install dependencies
|
||||
run: go get .
|
||||
- name: Build
|
||||
run: go build -v main.go
|
||||
name: go-app
|
||||
path: .
|
||||
|
||||
- name: 'Deploy to Azure Web App'
|
||||
- name: Deploy GitHub Pages site
|
||||
uses: actions/deploy-pages@v4.0.5
|
||||
id: deploy-to-pages
|
||||
|
|
Loading…
Reference in a new issue