Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Update Docker Images #222

Update Docker Images

Update Docker Images #222

name: Update Docker Images
on:
workflow_dispatch:
schedule:
- cron: "50 6 * * 0-6"
push:
tags:
- "*.*.*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
AWS_REGION: us-east-1
jobs:
generate-docker-images:
runs-on: ubuntu-latest
steps:
- name: Force Install GIT latest
run: |
sudo apt-get install -y software-properties-common \
&& sudo apt-get update \
&& sudo add-apt-repository -y ppa:git-core/ppa \
&& sudo apt-get update \
&& sudo apt-get install -y git \
&& git --version
- name: Checkout code
uses: actions/checkout@v2
- name: Get commit date for the triggering commit
run: |
COMMIT_DATE=$(git show -s --format="%cd" ${{ github.sha }})
echo "COMMIT_DATE=$COMMIT_DATE" >> $GITHUB_ENV
# Checkout the repository to the GitHub Actions runner
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Check tag format
id: check-tag
uses: actions-ecosystem/action-regex-match@v2
with:
text: ${{ github.ref }}
regex: 'refs/tags/[0-9]{4}\.[0-9]+\.[0-9]+$'
- name: Build and push edge mintter-site
uses: docker/build-push-action@v4
with:
push: true
build-args: |
COMMIT_HASH=${{ github.sha }}
BRANCH=${{ github.ref }}
DATE=${{ env.COMMIT_DATE }}
file: backend/cmd/mintter-site/Dockerfile
tags: mintter/mintter-site:main
- name: Build and push stable mintter-site
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.match
uses: docker/build-push-action@v4
with:
push: true
build-args: |
COMMIT_HASH=${{ github.sha }}
BRANCH=${{ github.ref }}
DATE=${{ env.COMMIT_DATE }}
file: backend/cmd/mintter-site/Dockerfile
tags: mintter/mintter-site:latest
- name: Build and push edge mintterd
uses: docker/build-push-action@v4
with:
push: true
file: backend/cmd/mintterd/Dockerfile
tags: mintter/mintterd:main
- name: Build and push stable mintterd
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.match
uses: docker/build-push-action@v4
with:
push: true
file: backend/cmd/mintterd/Dockerfile
tags: mintter/mintterd:latest
- name: Build and push edge monitord
uses: docker/build-push-action@v4
with:
push: true
file: backend/cmd/monitord/Dockerfile
tags: mintter/monitord:main
- name: Build and push stable monitord
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.match
uses: docker/build-push-action@v4
with:
push: true
file: backend/cmd/monitord/Dockerfile
tags: mintter/monitord:latest
- name: Build and push edge relay
uses: docker/build-push-action@v4
with:
push: true
file: backend/cmd/relayd/Dockerfile
tags: mintter/relayd:main
- name: Build and push stable relay
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.match
uses: docker/build-push-action@v4
with:
push: true
file: backend/cmd/relayd/Dockerfile
tags: mintter/relayd:latest
- name: Build and push edge nextjs
uses: docker/build-push-action@v4
with:
push: true
file: frontend/apps/site/Dockerfile
tags: mintter/sitegw:main
- name: Build and push stable nextjs
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.match
uses: docker/build-push-action@v4
with:
push: true
file: frontend/apps/site/Dockerfile
tags: mintter/sitegw:latest