Skip to content

Commit c244eba

Browse files
committed
Fixed GitHub Workflow
Upload artifacts in the build stage
1 parent 6915694 commit c244eba

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

.github/workflows/go.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,63 @@ on:
99
pull_request:
1010
branches: [ "main" ]
1111

12+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
13+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
1217

13-
jobs:
18+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
19+
permissions:
20+
contents: read
21+
pages: write # to deploy to Pages
22+
id-token: write # to verify the deployment originates from an appropriate source
1423

24+
jobs:
25+
# Build job
1526
build:
1627
runs-on: ubuntu-latest
1728
steps:
1829
- uses: actions/checkout@v4
1930
with:
2031
fetch-depth: 0 # Ensures full history, including tags
21-
2232
- name: Set up Go
2333
uses: actions/setup-go@v4
2434
with:
2535
go-version: '1.24.1'
26-
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v5
2738
- name: Build
2839
run: |
2940
go mod tidy # Ensures all required dependencies are installed
41+
echo "All required dependencies are installed"
42+
echo "Building undervolt-go..."
3043
go build -ldflags="-X 'main.version=$(git describe --tags)'" -o undervolt-go main.go # When building your application, pass the version from git tags using ldflags.
44+
echo "Build complete!"
45+
echo "Working on making the compiled binary available..."
3146
mkdir public
3247
cp -r ./undervolt-go ./public/ # Copy the binary to the public directory
3348
cp -r ./install/ ./public/ # Copy the scripts in the install directory to the public directory
34-
49+
echo "Ready to deploy!"
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
# Upload entire repository
54+
path: './public'
3555
#- name: Test
3656
# run: go test -v ./...
3757

3858
# Deploy job
3959
deploy:
4060
# Add a dependency to the build job
4161
needs: build
42-
43-
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
44-
permissions:
45-
contents: read
46-
pages: write # to deploy to Pages
47-
id-token: write # to verify the deployment originates from an appropriate source
48-
4962
# Deploy to the github-pages environment
5063
environment:
5164
name: github-pages
5265
url: ${{ steps.deployment.outputs.page_url }}
53-
5466
# Specify runner + deployment step
5567
runs-on: ubuntu-latest
5668
steps:
57-
- name: Checkout
58-
uses: actions/checkout@v4
59-
- name: Setup Pages
60-
uses: actions/configure-pages@v5
61-
- name: Upload artifact
62-
uses: actions/upload-pages-artifact@v3
63-
with:
64-
# Upload entire repository
65-
path: './public'
6669
- name: Deploy to GitHub Pages
6770
id: deployment
6871
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 commit comments

Comments
 (0)