Skip to content

Commit

Permalink
added build and push cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
joshika39 committed Apr 12, 2024
1 parent ec4dd23 commit 9ae4303
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Image CI

on:
release:
types: [published]

jobs:
build-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Log in to GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PUSH }}

- name: Lowercase the repo name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

- name: Build and push container hashed image to registry
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/${{ env.REPO }}:${{ github.sha }}
file: ./Dockerfile
- name: Build and push container latest image to registry
uses: docker/build-push-action@v4
with:
platforms: amd64,arm64
push: true
tags: ghcr.io/${{ env.REPO }}:latest
file: ./Dockerfile

0 comments on commit 9ae4303

Please sign in to comment.