From 251e8c9ef3504cca0946dcb97c0993dca280513e Mon Sep 17 00:00:00 2001 From: Bojan Raic Date: Sat, 20 Jan 2024 15:09:49 +0100 Subject: [PATCH] Add pipeline for nightly builds --- .github/workflows/docker-builds.yaml | 8 ---- .github/workflows/docker-nightly.yaml | 54 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/docker-nightly.yaml diff --git a/.github/workflows/docker-builds.yaml b/.github/workflows/docker-builds.yaml index 77570c1..d4f19b4 100644 --- a/.github/workflows/docker-builds.yaml +++ b/.github/workflows/docker-builds.yaml @@ -20,14 +20,6 @@ jobs: environment: 'dockerhub' runs-on: ubuntu-latest steps: - - name: Debug Step - run: | - echo "GITHUB_REF: $GITHUB_REF" - echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME" - echo "Ref: ${{ github.ref }}" - echo "Event name: ${{ github.event_name }}" - echo "Event ref: ${{ github.event.ref }}" - - name: Code Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/docker-nightly.yaml b/.github/workflows/docker-nightly.yaml new file mode 100644 index 0000000..63debc8 --- /dev/null +++ b/.github/workflows/docker-nightly.yaml @@ -0,0 +1,54 @@ +name: Docker Nightly Builds + +on: + workflow_dispatch: + schedule: + # 03.15 AM UTC + - cron: '15 3 * * *' + +jobs: + docker-image-build: + environment: 'dockerhub' + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: actions/checkout@v4 + + - name: Dockerhub Login + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PAT }} + + - name: Docker Buildx Setup + uses: docker/setup-buildx-action@v3 + + - name: Nighhly Build/Push + uses: docker/build-push-action@v5 + with: + push: true + platforms: | + linux/amd64 + context: src + tags: | + bojanraic/bwsm-eso:nightly + + - name: Most Recent Semver Tag + uses: actions-ecosystem/action-get-latest-tag@v1 + with: + semver_only: true + id: most-recent-tag + + - name: Switch to Most Recent Tag + if: steps.most-recent-tag.outputs.tag + run: git checkout ${{ steps.most-recent-tag.outputs.tag }} + + - name: Scheduled Tag Build/Push + uses: docker/build-push-action@v5 + with: + push: true + platforms: | + linux/amd64 + context: src + tags: | + bojanraic/bwsm-eso:${{ steps.most-recent-tag.outputs.tag }}