Skip to content

Commit

Permalink
Add actions wf to build and deploy image
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitj committed Jul 26, 2024
1 parent 6802554 commit 295a780
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy Docker image
on:
push:
tags:
- "*"

env:
REGISTRY: ghcr.io
IMG_NAME: ${{ github.repository }}

jobs:
docker_build_and_push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract tags, labels for image
id: metadata
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.IMG_NAME }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}

0 comments on commit 295a780

Please sign in to comment.