Skip to content

Commit

Permalink
Migrate workflows to GH Actions (#34)
Browse files Browse the repository at this point in the history
* Added action which can build and publish docker image

* renamed actions file to the correct syntax

* Fixed build_workflow syntax for using the action

* fixed spelling error

* Update yml syntax of the composite action

* removed docker login from build_and_publish actions

* Testing to see if docker image is built successfully

* Fixed spelling error when passing image name

* Removed the buildx setup

* Removed the build_and_publish action

* Added the dzil docker build job to build_workflow

* Added a reusable hadolint job

* Fixed syntax error

* Added print statements to identify the file being linted

* exporting ignore rules in the same line as the hadolint command

* testing environment variable export for ignore rules

* testing if env is set

* Updated hadolint job to specify ignore rules directly

* fixed syntax error

* Added perl job dependency on dzil job

* Improved step name

* Specified tag for the image built

* Added daily workflow

* testing if build works

* Testing both perl and dzil building for master

* testing dzil push on master

* trying out specific commits for github actions

* trying out specific commits for github actions

* Added merged and tagged workflows

* Removed commented code added for testing

* Addeded perl job dependency for dzil

* removed debug step

* updated actions and hadolint versions

* removed circleci config
  • Loading branch information
nihal-deriv authored Oct 10, 2023
1 parent 48d568a commit 6a0428c
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 106 deletions.
93 changes: 0 additions & 93 deletions .circleci/config.yml

This file was deleted.

49 changes: 36 additions & 13 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
name: Build workflow
run-name: Build workflow
on: [push]
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Explore-GitHub-Actions:
perl:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
-
name: Checkout code
uses: actions/checkout@v4
-
name: Build Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: '.'
tags: deriv/perl:latest
push: false
dzil:
needs: perl
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Build Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: 'dzil/'
tags: deriv/dzil:latest
push: false
hadolint:
uses: ./.github/workflows/hadolint.yml
48 changes: 48 additions & 0 deletions .github/workflows/daily_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Daily master test
run-name: Daily test on master branch
on:
workflow_dispatch:
schedule:
- cron: '05 19 * * *'
jobs:
perl:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Docker Login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build And Publish Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: '.'
tags: deriv/perl:latest
push: true
dzil:
needs: perl
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Docker Login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build And Publish Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: 'dzil/'
tags: deriv/dzil:latest
push: true
hadolint:
uses: ./.github/workflows/hadolint.yml
20 changes: 20 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
workflow_call:
jobs:
hadolint:
runs-on: ubuntu-latest
steps:
-
name: Checkout Code
uses: actions/checkout@v4
-
name: Install hadolint
run: |
sudo wget -O /usr/bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
sudo chmod +x /usr/bin/hadolint
-
name: Lint perl Dockerfile
run: hadolint --ignore DL3008 --ignore SC2046 --ignore DL3003 --ignore DL4006 --ignore DL3006 --ignore DL3005 Dockerfile
-
name: Lint dzil Dockerfile
run: hadolint --ignore DL3008 --ignore SC2046 --ignore DL3003 --ignore DL4006 --ignore DL3006 --ignore DL3005 dzil/Dockerfile
49 changes: 49 additions & 0 deletions .github/workflows/merged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Merged
run-name: Merged
on:
workflow_dispatch:
push:
branches:
- master
jobs:
perl:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Docker Login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build And Publish Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: '.'
tags: deriv/perl:latest
push: true
dzil:
needs: perl
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Docker Login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build And Publish Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: 'dzil/'
tags: deriv/dzil:latest
push: true
hadolint:
uses: ./.github/workflows/hadolint.yml
47 changes: 47 additions & 0 deletions .github/workflows/tagged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tagged
run-name: Tagged
on:
workflow_dispatch:
push:
branches:
- master
jobs:
perl:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Docker Login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build And Publish Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: '.'
tags: deriv/perl:latest
push: true
dzil:
needs: perl
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Docker Login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build And Publish Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: 'dzil/'
tags: deriv/dzil:latest
push: true

0 comments on commit 6a0428c

Please sign in to comment.