Skip to content

Commit

Permalink
Add GitHub action to build and publish images
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewslotin committed Jul 8, 2024
1 parent ff94971 commit 72e7175
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Continuous Delivery
on:
push:
tags:
- 'v*.*.*'

jobs:
build:
name: Buid and push Docker image to GitHub Container registry
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3.4.0

- name: Docker Login
uses: docker/login-action@v3.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker images
uses: docker/build-push-action@v6.3.0
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
with:
context: .
file: ./Dockerfile
target: final
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

0 comments on commit 72e7175

Please sign in to comment.