Skip to content

init build 2

init build 2 #1

name: Docker
on:
push:
branches: ["master"]
jobs:
build:
name: Build & puch docker image
runs-on: ubuntu-latest
env:
IMG_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.IMG_NAME }}
tags: |
# type=sha
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.metadata.outputs.tags }}
tags: devbyteops/aws-cli:0.0.1
labels: ${{ steps.metadata.outputs.labels }}