Skip to content

Build and Publish Docker Image Weekly #14

Build and Publish Docker Image Weekly

Build and Publish Docker Image Weekly #14

name: Build and Publish Docker Image Weekly
on:
schedule:
- cron: "0 1 * * Sun"
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
ORG_NAME: kaakaww
IMAGE_NAME: dvwa-docker
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
push_tags: |
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
manifest: true
manifest_tags: |
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
platforms: |
linux/amd64,linux/arm64,linux/arm/v7