From dcc3758aa9bbce728fa7a90c95829c342a76f60b Mon Sep 17 00:00:00 2001 From: Marcos Huck Date: Sun, 11 Feb 2024 23:59:47 -0300 Subject: [PATCH 1/2] Allow building OCI images Signed-off-by: Marcos Huck --- .github/workflows/build.yaml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..bceba56 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,47 @@ +name: build + +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 }} \ No newline at end of file From 8143b08baa2afd674126f302cd95783fa0e1b7a5 Mon Sep 17 00:00:00 2001 From: Marcos Huck Date: Mon, 12 Feb 2024 00:01:43 -0300 Subject: [PATCH 2/2] Improve CI name Signed-off-by: Marcos Huck --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bceba56..761ffd5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: build +name: Build and push on: push: