Skip to content

Commit

Permalink
GA1
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaldivyam committed Apr 1, 2024
1 parent c4652f6 commit 679ca98
Showing 1 changed file with 39 additions and 29 deletions.
68 changes: 39 additions & 29 deletions .github/workflows/logical-backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,55 @@ name: Build Logical backup

on:
push:
branches: [ "*" ]
paths: 'logical-backup/**'
branches: [ "fix-logical-backup" ]
tags: [ "v*" ]

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Generate container metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/obmondo/logical-backup
tags: |
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=ref,event=tag
flavor: |
latest=false
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44

- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
# - name: Generate container metadata
# id: meta
# uses: docker/metadata-action@v3
# with:
# images: ghcr.io/obmondo/logical-backup
# tags: |
# type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
# type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
# type=ref,event=tag
# flavor: |
# latest=false
# - 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 & push container image
id: docker_build
uses: docker/[email protected]
with:
file: "./logical-backup/Dockerfile"
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
# - name: Build & push container image
# id: docker_build
# uses: docker/[email protected]
# with:
# file: "./logical-backup/Dockerfile"
# context: .
# labels: ${{ steps.meta.outputs.labels }}
# push: true
# tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 679ca98

Please sign in to comment.