This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
Build and Push Docker Image #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 */14 * *' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker HUB | |
run: echo ${{ secrets.DOCKERPASSWORD }} | docker login --username omanshkrishn --password-stdin | |
- name: Build and push Docker image | |
run: | | |
docker buildx create --use | |
docker buildx inspect --bootstrap | |
docker buildx build -t omanshkrishn/materialgram:latest -t omanshkrishn/materialgram:$(date +%Y%m%d%H%M%S) --platform linux/amd64 . --push |