Skip to content

Commit

Permalink
Merge pull request #2 from flownative/task/fix-build
Browse files Browse the repository at this point in the history
Update build action
  • Loading branch information
kdambekalns authored Jun 29, 2022
2 parents c9f6635 + cdca21b commit e641f84
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 92 deletions.
78 changes: 64 additions & 14 deletions .github/workflows/docker.build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Build Docker Image
on:
schedule:
- cron: '30 0 * * *'
push:
branches-ignore:
- '**'
Expand All @@ -11,21 +13,69 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'main'
fetch-depth: 100

- name: Build Docker image
id: build_image
uses: flownative/action-docker-build@v1
- name: Determine latest version
id: latest_version
uses: flownative/action-git-latest-release@master

- run: |
sudo chmod -R ugo+rwX . && shopt -s dotglob && rm -rf *
- uses: actions/checkout@v2
with:
ref: ${{ steps.latest_version.outputs.tag }}
fetch-depth: 100

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
tag_ref: ${{ github.ref }}
git_repository_url: https://github.com/${{ github.repository }}
git_sha: ${{ github.sha }}
image_name: flownative/docker-borgbackup/borgbackup
registry_password: ${{ secrets.GITHUB_BOT_TOKEN }}

- name: Dispatch
uses: peter-evans/repository-dispatch@v1
flavor: |
latest=true
images: |
flownative/borgbackup
europe-docker.pkg.dev/flownative/docker/borgbackup
labels: |
org.opencontainers.image.title=Borgbackup
org.opencontainers.image.description=Docker image providing borgbackup
org.opencontainers.image.licenses=MIT
org.opencontainers.image.vendor=Flownative GmbH
org.opencontainers.image.version=${{ steps.latest_version.outputs.version }}
tags: |
type=semver,pattern={{major}},value=${{ steps.latest_version.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest_version.outputs.version }}
type=semver,pattern={{version}},value=${{ steps.latest_version.outputs.version }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1

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

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
token: ${{ secrets.GITHUB_BOT_TOKEN }}
event-type: image-built
client-payload: '{"image_name": "${{ steps.build_image.outputs.image_name }}", "image_tag": "${{ steps.build_image.outputs.image_tag }}"}'
username: ${{ secrets.DOCKER_IO_REGISTRY_USER }}
password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }}

- name: Login to Google Artifacts Registry
uses: docker/login-action@v1
with:
registry: europe-docker.pkg.dev/flownative/docker
username: '_json_key'
password: ${{ secrets.GOOGLE_ARTIFACTS_PASSWORD_DOCKER }}

- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
34 changes: 0 additions & 34 deletions .github/workflows/docker.nightly.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/docker.release.yaml

This file was deleted.

0 comments on commit e641f84

Please sign in to comment.