Skip to content

Commit

Permalink
workflow setup complete
Browse files Browse the repository at this point in the history
  • Loading branch information
sweta20singh2004 committed Jul 20, 2024
1 parent 15e1a9b commit 78c0307
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
# Schedule for automatic builds:
# schedule:
- cron: '0 0 * * *' # Every day at midnight UTC

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: |
/tmp/.buildx-cache
/tmp/.buildkit
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image
run: |
docker buildx build --push --tag hanisntsolo/codeforces-lamp:latest .
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

0 comments on commit 78c0307

Please sign in to comment.