Skip to content

Commit

Permalink
Merge pull request #104 from marcoshuck/feature/build_oci
Browse files Browse the repository at this point in the history
Allow building OCI images in CI
  • Loading branch information
marcoshuck authored Feb 12, 2024
2 parents a4b3796 + 8143b08 commit edb5571
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and push

on:
push:
tags:
- v*

jobs:
docker:
runs-on: ubuntu-latest

strategy:
matrix:
name: [ app, gateway ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: "ghcr.io/marcoshuck/todo/${{ matrix.name }}"
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: .
file: "./build/${{ matrix.name }}.Dockerfile"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit edb5571

Please sign in to comment.