Skip to content

Commit

Permalink
feat: add github cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisaAkiron committed Mar 7, 2024
1 parent 5572b3b commit 675d466
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Build image and upload to ghcr.io"

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: "Docker: Setup Buildx"
uses: docker/setup-buildx-action@v2

- name: "Docker: Login to GitHub Container Registry"
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: "Docker: Metadata"
id: docker-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/LiamSho/pg-auto-backup
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=pr
type=sha
- name: "Docker: Build and Push Image"
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}

0 comments on commit 675d466

Please sign in to comment.