Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build.yml #40

Merged
merged 6 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- 'main'
# - 'staging'
# - 'dev'
# - 'hotfix/**'
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -43,3 +40,44 @@ jobs:
file: Dockerfile
push: true
tags: quay.io/denbicloud/cron-backup:${{ steps.tag.outputs.TAG }}

special_builds:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
type: [ postgresql, mysql, mongodb ]
steps:

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Set tag
run: sed 's/\//-/g' <<< "::set-output name=TAG::${{ steps.extract_branch.outputs.branch }}"
id: tag

- name: Get tag
run: echo "The selected tag is ${{ steps.tag.outputs.TAG }}"
- uses: actions/checkout@master
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and publish image to Quay
uses: docker/build-push-action@v5
env:
BASE_TAG: ${{ steps.tag.outputs.TAG }}
with:
file: ${{matrix.type}}/Dockerfile
context: ${{matrix.type}}
push: true
build-args: BASE_TAG
tags: quay.io/denbicloud/cron-backup:${{matrix.type}}-${{ steps.tag.outputs.TAG }}
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ RUN apk add --update --no-cache \
bash \
gnupg \
fdupes \
python3 \
py3-pip \
s3cmd \
busybox-extras \
ssmtp

RUN pip3 install --upgrade pip
RUN pip3 install s3cmd

RUN touch /var/log/cron.log

COPY ./prepare-cron.sh /prepare-cron.sh
Expand Down
Loading