Skip to content

Commit

Permalink
only uodate minor versions on schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
ansnoussi committed Aug 23, 2023
1 parent 8720c4f commit dfa116d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/continuous_delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Continuous Delivery
on:
release:
types: [ published ]
schedule:
- cron: '0 0 * * 0' # every sunday at midnight

jobs:

Expand All @@ -18,16 +16,25 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Checkout source code
uses: actions/checkout@v3
- name: Get latest release tag
id: latest_tag
- name: Get the latest minor release tag
id: latest_minor_release_tag
run: |
echo ::set-output name=tag::$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name')
# Split the tag into major, minor, patch
IFS='.' read -ra VERSION_PARTS <<< "${{ github.event.release.tag_name }}"
# Construct the tag
NEW_TAG="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}"
# Set the tag as an output
echo "::set-output name=tag::$NEW_TAG"
- name: Log in to Docker Hub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
run: |
make release GOTENBERG_VERSION=${{ github.event.release.tag_name || steps.latest_tag.outputs.tag }}
make release GOTENBERG_VERSION=${{ github.event.release.tag_name || steps.latest_tag.outputs.tag }} DOCKER_REPOSITORY=thecodingmachine
make release GOTENBERG_VERSION=${{ github.event.release.tag_name }}
make release GOTENBERG_VERSION=${{ github.event.release.tag_name }} DOCKER_REPOSITORY=thecodingmachine
make release GOTENBERG_VERSION=${{ steps.latest_minor_release_tag.outputs.tag }}
make release GOTENBERG_VERSION=${{ steps.latest_minor_release_tag.outputs.tag }} DOCKER_REPOSITORY=thecodingmachine
41 changes: 41 additions & 0 deletions .github/workflows/weekly_updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Weekly Docker Image Builds

on:
schedule:
- cron: '0 0 * * 0' # every sunday at midnight

jobs:

release:
name: Release Docker image
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout source code
uses: actions/checkout@v3
- name: Get the latest minor release tag
id: latest_minor_release_tag
run: |
# Get the latest released tag
LATEST_TAG=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name')
# Split the tag into major, minor, patch
IFS='.' read -ra VERSION_PARTS <<< $LATEST_TAG
# Construct the tag
NEW_TAG="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}"
# Set the tag as an output
echo "::set-output name=tag::$NEW_TAG"
- name: Log in to Docker Hub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
run: |
make release GOTENBERG_VERSION=${{ steps.latest_minor_release_tag.outputs.tag }}
make release GOTENBERG_VERSION=${{ steps.latest_minor_release_tag.outputs.tag }} DOCKER_REPOSITORY=thecodingmachine

0 comments on commit dfa116d

Please sign in to comment.