Skip to content

Commit

Permalink
feat: push docker image to ghcr (#70)
Browse files Browse the repository at this point in the history
* Update release.yaml
  • Loading branch information
mjavier2k authored Sep 1, 2021
1 parent dedf517 commit 6e90592
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

on: release
name: Build
jobs:
Expand Down Expand Up @@ -106,3 +110,31 @@ jobs:
EXECUTABLE_NAME: "solidfire-exporter"
EXECUTABLE_PATH: "./cmd/solidfire-exporter"
PACKAGE: "./cmd/solidfire-exporter/main.go"

push_to_registry:
name: Push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 6e90592

Please sign in to comment.