Skip to content

Commit

Permalink
Merge pull request #772 from flatcar/kai/release-ga
Browse files Browse the repository at this point in the history
.github: Add GitHub Action to release container image
  • Loading branch information
pothos authored Apr 25, 2024
2 parents ed727b0 + cc6472c commit be3c526
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Container Image
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- 'staging'
env:
REGISTRY: ghcr.io
IMAGE_NAME: flatcar/nebraska

jobs:
build:
name: Build Container Image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Get tag name
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
type=match,pattern=\d.\d.\d,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Check out code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit be3c526

Please sign in to comment.