diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 949333d..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,93 +0,0 @@ -version: 2.1 -orbs: - docker: circleci/docker@2.1.1 -aliases: - - &filter_only_master - branches: - only: - - /^master$/ - - &options_hadolint - dockerfiles: Dockerfile:dzil/Dockerfile - # Don't pin apt versions, we'll never remember to update them - ignore-rules: DL3008,SC2046,DL3003,DL4006,DL3006,DL3005 - - &options_workflow_perl - context: perl - name: perl - - &options_workflow_perl_push - push: true - filters: *filter_only_master - <<: *options_workflow_perl - - &options_workflow_dzil - requires: - - perl - context: perl - name: dzil - image: deriv/dzil - path: dzil/ - docker-context: dzil/ - - &options_workflow_dzil_push - push: true - filters: *filter_only_master - <<: *options_workflow_dzil -jobs: - build_and_publish: - executor: - name: docker/machine - image: ubuntu-2004:202107-02 - parameters: - push: - type: boolean - default: false - image: - type: string - default: deriv/perl - path: - type: string - default: . - docker-context: - type: string - default: . - steps: - - checkout - - docker/build: - image: <> - path: <> - docker-context: <> - tag: 'latest' - - when: - condition: <> - steps: - - run: - name: Docker Hub login - command: echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_LOGIN" --password-stdin - - docker/push: - image: <> - tag: 'latest' -workflows: - version: 2 - build-workflow: - jobs: - - build_and_publish: *options_workflow_perl - - build_and_publish: *options_workflow_dzil - - docker/hadolint: *options_hadolint - - merged: - jobs: - - build_and_publish: *options_workflow_perl_push - - build_and_publish: *options_workflow_dzil_push - - docker/hadolint: - <<: *options_hadolint - filters: *filter_only_master - tagged: - jobs: - - build_and_publish: *options_workflow_perl_push - - build_and_publish: *options_workflow_dzil_push - daily: - jobs: - - build_and_publish: *options_workflow_perl_push - - build_and_publish: *options_workflow_dzil_push - - docker/hadolint: *options_hadolint - triggers: - - schedule: - cron: 05 19 * * * - filters: *filter_only_master diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index a64dcd5..d30d81c 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -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 diff --git a/.github/workflows/daily_master.yml b/.github/workflows/daily_master.yml new file mode 100644 index 0000000..4b68df9 --- /dev/null +++ b/.github/workflows/daily_master.yml @@ -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 diff --git a/.github/workflows/hadolint.yml b/.github/workflows/hadolint.yml new file mode 100644 index 0000000..0a76c65 --- /dev/null +++ b/.github/workflows/hadolint.yml @@ -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 diff --git a/.github/workflows/merged.yml b/.github/workflows/merged.yml new file mode 100644 index 0000000..068f98f --- /dev/null +++ b/.github/workflows/merged.yml @@ -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 diff --git a/.github/workflows/tagged.yml b/.github/workflows/tagged.yml new file mode 100644 index 0000000..2337775 --- /dev/null +++ b/.github/workflows/tagged.yml @@ -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