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
|
name: Go on Pages
|
||||||
on: [push]
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v5
|
- 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:
|
with:
|
||||||
go-version: '1.21.x'
|
name: go-app
|
||||||
- name: Install dependencies
|
path: .
|
||||||
run: go get .
|
|
||||||
- name: Build
|
- name: 'Deploy to Azure Web App'
|
||||||
run: go build -v main.go
|
- name: Deploy GitHub Pages site
|
||||||
|
uses: actions/deploy-pages@v4.0.5
|
||||||
|
id: deploy-to-pages
|
||||||
|
|
Loading…
Reference in a new issue