33 lines
832 B
YAML
33 lines
832 B
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
image: quay.io/buildah/stable
|
|
options: --privileged
|
|
|
|
steps:
|
|
- name: Install Node.js
|
|
run: dnf install -y nodejs git
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Login to Registry
|
|
run: buildah login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} git.kocoder.xyz
|
|
|
|
- name: Buildah Build
|
|
run: |
|
|
buildah build -t ${{ github.ref_name }} .
|
|
buildah tag ${{ github.ref_name }} latest
|
|
|
|
- name: Push Docker Images
|
|
run: |
|
|
buildah push ${{ github.ref_name }} docker://git.kocoder.xyz/kocoded/vt-be:${{ github.ref_name }}
|
|
buildah push latest docker://git.kocoder.xyz/kocoded/vt-be:latest
|