Skip to content

Test GA

Test GA #53

Workflow file for this run

name: Build Logical backup
on:
push:
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: Get all changed docker and shell script files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
**/Dockerfile
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "::set-output name=changed-files::$(echo "$ALL_CHANGED_FILES" | tr '\n' ',')"
- name: Convert output to array
id: convert-to-array
run: |
IFS=',' read -r -a CHANGED_FILES_ARRAY <<< "${{ steps.list-changed-files.outputs.changed-files }}"
echo "::set-output name=changed-files-array::${CHANGED_FILES_ARRAY[@]}"
- name: Generate container metadata
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/obmondo/${{ steps.convert-to-array.outputs.changed-files-array}}
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: "${{ steps.changed-files.outputs.all_changed_files }}"
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}