Skip to content

Commit

Permalink
Create docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pyToshka committed Oct 18, 2022
1 parent ba45ae8 commit e41d129
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
-
name: Checkout
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
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Extract metadata (tags, labels) for Docker
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@v4
with:
images: kennyopennix/wazuh-agent
tags: |
type=raw,value=latest,enable={{is_default_branch}}
-
name: Build and push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit e41d129

Please sign in to comment.