Skip to content

Commit

Permalink
ci: publish img to github registry
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed May 9, 2024
1 parent 20393ad commit 0e40490
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-img.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Push container image
on:
push:
branches:
- main
pull_request:
branches: [ "main" ]
env:
image-push-owner: 'maiqueb'
jobs:
push-amd64:
name: Image push/amd64
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Version Check
run: |
echo "git_commit_hash=$(git describe --no-match --always --abbrev=8 --dirty)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Container Registry
if: github.repository_owner == 'maiqueb'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push container image
if: github.repository_owner == 'maiqueb'
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.git_commit_hash }}
file: Dockerfile

0 comments on commit 0e40490

Please sign in to comment.