Skip to content

Commit

Permalink
use verbatim action yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Feb 28, 2024
1 parent a2f1d54 commit d18ab7a
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/docker-build-push.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
name: Build and Push mqtt-simulator image to ghcr.io
name: ci

on:
schedule:
- cron: "0 10 * * *"
push:
branches:
- "master"
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- "master"
- "main"

env:
IMAGE_NAME: mqtt-simulator

jobs:
buildx-push:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4

- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand All @@ -44,13 +36,23 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- 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
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
driver-opts: network=host
platforms: linux/amd64,linux/arm64

username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
Expand Down

0 comments on commit d18ab7a

Please sign in to comment.