Skip to content

Commit

Permalink
combine workflows to build image after release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanishq Rupaal authored and Tanishq Rupaal committed Nov 30, 2024
1 parent cd99e74 commit 36cd139
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 32 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/docker.yml

This file was deleted.

25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Release Build
on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: write
Expand All @@ -18,7 +19,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine Version
id: version
run: |
Expand All @@ -42,7 +42,6 @@ jobs:
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}

- name: Create Release
id: create_release
run: |
Expand All @@ -63,16 +62,13 @@ jobs:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'

- name: Build Binary
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o budgetlord-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }} ./cmd/budgetlord
- name: Upload Release Asset
run: |
gh release upload "${{ needs.create-release.outputs.version }}" \
Expand All @@ -85,9 +81,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Publish Release
run: |
gh release edit "${{ needs.create-release.outputs.version }}" --draft=false
env:
GH_TOKEN: ${{ github.token }}

docker:
needs: [create-release, build, publish]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: tanq16
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: tanq16/budgetlord:main

0 comments on commit 36cd139

Please sign in to comment.