Skip to content

Commit

Permalink
Create build-push-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalthaheem authored Apr 6, 2022
1 parent 3b6cb86 commit 610a416
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-push-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish Docker Image

on:
push:
branches: [ dev ]
release:
types:
- published

jobs:

build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest

steps:
- name: Check out
uses: actions/checkout@v2

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/peaqnetwork/peaq-node-builder
tag-sha: true
tag-edge: false
tag-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

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

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_PUBLISHING_USERNAME }}
password: ${{ secrets.GHCR_PUBLISHING_TOKEN }}

- name: Build image
uses: docker/build-push-action@v2
with:
tags: ${{ steps.docker_meta.outputs.tags }}
file: ./build-image/Dockerfile

# - name: Monitor image for vulnerabilities with Snyk
# uses: snyk/actions/docker@master
# env:
# SNYK_TOKEN: ${{ secrets.SNYK }}
# with:
# command: monitor
# image: "ghcr.io/gbaeke/rgapi:main"
# args: --file=Dockerfile --project-name=rgapi

- name: Push image
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
file: ./build-image/Dockerfile

0 comments on commit 610a416

Please sign in to comment.