Skip to content

Commit

Permalink
add build and push workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bbilly1 committed Aug 11, 2024
1 parent d137165 commit e58baed
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Push Docker Image

on:
push:
tags:
- 'v*'

jobs:
build-and-push:
runs-on: ubuntu-latest
needs: [lint, test]
if: needs.lint.result == 'success' && needs.test.result == 'success'

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image with tags
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
lint:
runs-on: ubuntu-latest

outputs:
lint-status: ${{ steps.lint-check.conclusion }}

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
test:
runs-on: ubuntu-latest

outputs:
test-status: ${{ steps.test-check.conclusion }}

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down

0 comments on commit e58baed

Please sign in to comment.