-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgo-build-mkdocs-docker.yml
More file actions
138 lines (114 loc) · 3.44 KB
/
go-build-mkdocs-docker.yml
File metadata and controls
138 lines (114 loc) · 3.44 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Go Build, Docker & MkDocs Deployment
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch: # Allows manual execution
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build for Linux
run: |
GOARCH=amd64 GOOS=linux go build -o 3270Connect go3270Connect.go
- name: Test Go Project
run: go test -v ./...
- name: Run Linux Binary (Verbose & Headless)
run: |
chmod +x ./3270Connect
./3270Connect -runApp 1
./3270Connect -verbose -headless
- name: Upload Linux Binary
uses: actions/upload-artifact@v4
with:
name: 3270Connect-linux
path: 3270Connect
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build for Windows
shell: pwsh
run: |
$env:GOARCH="amd64"
$env:GOOS="windows"
go build -o 3270Connect.exe go3270Connect.go
- name: Test Go Project
run: go test -v ./...
- name: Run Windows Binary (Verbose & Headless)
shell: pwsh
run: |
.\3270Connect.exe -runApp 1
.\3270Connect.exe -verbose -headless
- name: Upload Windows Binary
uses: actions/upload-artifact@v4
with:
name: 3270Connect-windows
path: 3270Connect.exe
build-and-push-docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # Required for GHCR push
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Linux Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
file: ./Dockerfile
target: final-linux
tags: ghcr.io/${{ github.repository_owner }}/3270connect:linux-latest
- name: Build and Push Windows Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: windows/amd64
file: ./Dockerfile
target: final-windows
tags: ghcr.io/${{ github.repository_owner }}/3270connect:windows-latest
build-and-deploy-mkdocs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python and Install MkDocs
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install MkDocs and Dependencies
run: |
pip install mkdocs mkdocs-material mkdocs-video
- name: Build MkDocs Site
run: |
mkdocs build
- name: Deploy to GitHub Pages (gh-pages branch)
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./site